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
Explain the Symbolic Constants in c language? Symbolic constants are the constants of any type that declared by using the #define compiler directive and it is a preprocessor di

I''m trying to write a function that prints the substring if it is found in the string, and after it prints it deletes it from the string so i could print the next substring if it

Explain Operator Overloading It is one type of Polymorphism, an significant feature of object-oriented programming .Polymorphism means one thing having many forms, i.e. here an

MAT LAB programming Project Description: Just for who are PROFESSIONAL IN MATLAB i have simulation and i would like to simulate the equation in ,and test the all simulatio

good night i have an assignment that i really need help with. i have to create a struct file with tag name book to have members int book_id char isbn[255]


Problem : (a) Stacks can be implemented using arrays. Write down the following C or C++ function to (i) create a stack (ii) add an element to a stack (push). (b) Expl

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''''{'''' and end with ''''}

What is the use of default constructor? - It's a constructor that doesn't accept any parameters. - If there is no user-defined constructor for a class, compiler declares a d

The for Loop For loop is the controlled form of loop. The general format of this : for( initialize ; test ; update)                  {                     statements;