Store marks and name, roll no in a file - c program , C/C++ Programming

Program is to store marks and name, roll no in a file:

class stud

  {

    int rno;

    char name[20];

    int m1,m2,m3;

    public:

                void accept()

                                {

                                cout<<"enter the roll no. : ";

                                cin>>rno;

                                cout<<"enter the name : ";

                                gets(name);

                                cout<<"enter marks of 3 subjects : ";

                                cin>>m1>>m2>>m3;

                                }

    };

     void main()

     {

     clrscr();

     stud s;

     s.accept();

     ofstream a ("stud.dat" , ios::binary | ios::app);

     a.write ( (char *) &s , sizeof(s) );

     a.close();

     }

Posted Date: 10/19/2012 5:40:22 AM | Location : United States







Related Discussions:- Store marks and name, roll no in a file - c program , Assignment Help, Ask Question on Store marks and name, roll no in a file - c program , Get Answer, Expert's Help, Store marks and name, roll no in a file - c program Discussions

Write discussion on Store marks and name, roll no in a file - c program
Your posts are moderated
Related Questions
what is virtual datatype

Write a program that does the following: Calculates the Velocity and Momentum of an object. The formula for the velocity is V=d/t and the formula Momentum is m=mass*velocity. Your

c program for boardcolouring

Write a function for finding out highest and lowest marks obtained by a student from an array contained student name and marks. For Example : GetHighestLowestMarks{Student{n}, Ma

Write a program to count the prime number in array

Why many companies are switching their current business language to PHP? Where PHP basically used? PHP is rapidly gaining popularity and numerous companies are switching their

What are the various types of control structures in programming? - Primarily there are 3 types of control structures in programming: Sequence, Selection and Repetition. - Se


WAP TO PRINT ANY NAME ON SCREEN 10 TIMES void main () { int a=1; clrscr(); do { printf ("expertsmind\n"); a++; } while (a getch (); }

Inheritance is the process of forming new classes, called derived classes, from existing classes or base classes. The derived class inherits all the capabilities of the base class,