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

Compiler design-limit the methods, Ask question #Minimum 100Problem : Compi...

Ask question #Minimum 100Problem : Compiler Design - Limit the methods Rahul is a newbie to the programming and while learning the programming language he came to know the followi

Define advantages of multi file program, Define Advantages of Multi File Pr...

Define Advantages of Multi File Program? The main merits of spreading a program across several files are: • Teams of programmers able to work on programs. Every programmer w

#title minimization and maxmization assignment problem, how we can code in ...

how we can code in c++ for assignment problem (operation research) method to mkinimization and mamization

Luminous Jewels - The Polishing Game, Byteland county is very famous for lu...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Program to show the ascii value of characters, Program to show the ascii va...

Program to show the ascii value of characters: int main() {                 int one_char;                 cout                 one_char = getch();

Function, Write a C++ program according to the following specifications 1. ...

Write a C++ program according to the following specifications 1. Display a brief description of the program. 2. Ask the user to specify the type of loading (end load, intermediate

C program for string address, C Program for STRING ADDRESS #include std...

C Program for STRING ADDRESS #include stdio.h> #include conio.h> #include string.h> void main() {           char *name;           int length;           cha

Flowcharting., flowcharting of 3 quizes display the average

flowcharting of 3 quizes display the average

Selection sort, Selection Sort using this a nested for loop to iterate thro...

Selection Sort using this a nested for loop to iterate through and compare the array elements. If the value of an element with lower index is greater than the value of an element w

Create a minimum of fifteen functions, Purpose For this assignment you ...

Purpose For this assignment you will need to create either a function list or a record series for a CRCRS. Instructions Note: Complete only one of the two assignment op

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