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
We have used logic symbols in the past, but not really though about the actual real devices. Semiconductor companies have taken the logic symbols are manufactured them into logic f

We move a high quantity of large Video files (200mb - 2 GB each) across the internet. We have a Linux server (ubuntu) hosted in a datacenter (1Gbps) operating an FTP server. Our


create two array names and grade .in first array you have to store thease 10 names 1.a,2.3.r,4.s,5.l,6.k,7.n,8.b,9.z,10.d you have to enter grades for thease students.te program mu

(a) Verify the values of the resistors with the following colour coding: (i) red-red-orange-silver (ii) orange-orange-black-blue-green (b) What is the value of a resistor


Automatic Variables Automatic variables are variable which are explained within the functions. They lose their value when the function terminates. It can be accessed only in th

Program of function overloading: class vector{                 private :                 int v[3];                   public:                 /*friend istream &

decoding message

Polymorphism C++ supports this idea - that different objects do "the right thing "- by function polymorphism and class polymorphism. Poly means many, while morph means form.