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

Assignment Help:

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();

     }


Related Discussions:- Store marks and name, roll no in a file - c program

Bankers algorithm, creating a system having five process from p0 to p4 and ...

creating a system having five process from p0 to p4 and five resource types. create the need matrix use the safe algorithm to test if the system is in safe mode.

Client server using c, (a) client server or multithreaded client-server, wh...

(a) client server or multithreaded client-server, where server will create pool of worker threads (say 5) to provide services to pool of clients (say 5 ).Server should be behaving

Nested if else, input marks of c and c++ if c grater than equal to 50 grate...

input marks of c and c++ if c grater than equal to 50 grater than 50 you are pass if c greater than equal to 50 c++ less than 50 than supplementry c++ if c less then 50 and c++ gra

write a scheme procedure to evaluate expression, (a) Write a Scheme proced...

(a) Write a Scheme procedure to evaluate the expression: 7/6+2*5+(3*2+6*7)*4. (b) Write a Scheme procedure to evaluate the expression: 2*(-1+(-3+4*2-7)*3/(3*2)).

Sort wars, Explain each of the algorithms in a way that would be understand...

Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code

Friend function, Ask question #Minimum 100 what is friend function is used ...

Ask question #Minimum 100 what is friend function is used in c++

Parking garage, A parking garage charges a $2.00 minimum fee to park for up...

A parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $0.50 per hour for each hour or part thereof over three hours. The maximum charge for a

Area under curve , c-program to find the area under the curve y=f(x) betwe...

c-program to find the area under the curve y=f(x) between x=a and x=b integrate y=f(x) between the limits of a and b   #include float start_point, /

Want wellness software, Project Description: We are looking to have soft...

Project Description: We are looking to have software that we will use to track employee information regarding our wellness program. We would like the system to be able to follow

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd