Store first n natural no in a file - c program, C/C++ Programming

Program is to store first n natural no in a file:

Write a program to store first n natural no in a file

void main()

    {

    fstream file;

    file.open("student.dat",ios::in|ios::out|ios::app);

    int n;

    cout<<" enter record to be modified ";

    cin>>n;

    file.seekg((n-1)*sizeof());

    file.read((char *)&  ,sizeif());

    file.write((char *)&  ,sizeof());

    file.close();

    }

Posted Date: 10/19/2012 5:37:09 AM | Location : United States







Related Discussions:- Store first n natural no in a file - c program, Assignment Help, Ask Question on Store first n natural no in a file - c program, Get Answer, Expert's Help, Store first n natural no in a file - c program Discussions

Write discussion on Store first n natural no in a file - c program
Your posts are moderated
Related Questions
At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

Problem: (a) (i) What is a structure? (ii) How does a structure differ from an array? (b) Declare a structure, called account, that will contain the following data me

how to do an array

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

a program code for superposition of sine waves

Should I call a destructor explicitly on a local variable?


M em b e r d e r e f e r e n c i ng o p e r a t o r s: T h e s e op e r a t o r s w i l l b e d i s c u s s e d l a t

to find prime numbers upto any number say "n" entered by user

Write a simple telephone book program that stores the names and phone numbers of your friends/acquaintances in a file. Your program should have the abilities to: a. Add entries (n