C++ program for store student detail in a file:- In this post i am going to write a C++ program that illustrate the use of file handling in C++. File handling requires when we want to save data for in future, if the data require then we can easily get them. Since, the life of a variables which we make in a program less than the life of the program. As soon as the program end the variables also vanished. The following program construct a structure student containing the field for Roll no., Name, Class, Year and total marks. Let's begin the program:- #include <iostream> #include <fstream> using namespace std ; struct student { int RollNo ; char Name [ 30 ]; int year ; char class1 [ 30 ]; float total_marks ; }; void ReadStudent ( student & TempStud ) { cout << "\n Enter roll no.: " ; cin >> TempStud.RollNo ; cin . clear (); fflush ( stdin ); ...
Here we provides C++ programming tutorials, or C++ language tutorials.for the beginners.