C++ Program for Student Database using File handling

By | 04.01.2017

Student Database using File handling


Write a C++ Menu Driven Program to perform Add,Modify,Append and Display in File Handling. Here’s simple Program for Student Database using File handling  in C++ Programming Language.


Below is the source code for C++ Program for Student Database using File handling which is successfully compiled and run on Windows System to produce desired output as shown below :


SOURCE CODE : :



OUTPUT : :



Above is the source code for C++ Program for Student Database using File handling which is successfully compiled and run on Windows System.The Output of the program is shown above .

If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach up to you in short interval.


Thanks for reading the post….

0 0 vote
Article Rating
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
muhammad shahid

case 4 :
{
ifstream infile;
infile.open(“C:\\Users\\acer\\Documents\\file4.txt”,ios::in);
const int size=80;
char line[size];
int counter=totrec;
while(counter > 0)
{
infile.getline(line,size);
cout<<"\n\nNAME : "<<line<<endl;
infile.getline(line,size);
cout<<"AGE : "<<line<<endl;
infile.getline(line,size);
cout<<"LANGUAGE : "<<line<<endl;
counter–;
}
infile.close();
}
break;

code not displaying outcome

muhammad shahid

#include #include using namespace std; static int totrec=0; int main() { int choice; while(1) { cout<<"\nChoose your choice :: \n"; cout<<"1) Add New Record\n"; cout<<"2) Append New records\n"; cout<<"3) Modifying or Append new records\n"; cout<<"4) Display records\n"; cout<<"5) Exit\n"; cout<>choice; switch (choice) { case 1 : { ofstream outfile; outfile.open(“C:\\Users\\acer\\Documents\\file4.txt”,ios::out); cout<<"\n\nPlease Enter Details :: \n"; cout<>name; outfile<<name<<endl; cout<>age; outfile<<age<<endl; cout<>lang; outfile<<lang<<endl; totrec= totrec + 1; outfile.close(); } break; case 2 : { ofstream outfile; outfile.open("C:\\Users\\acer\\Documents\\file4.txt",ios::app); cout<<"\n\nPlease Enter Details :: \n"; cout<>name; outfile<<name<<endl; cout<>age; outfile<<age<<endl; cout<>lang; outfile<<lang<<endl; totrec= totrec + 1; outfile.close(); } break; case 3 : { ofstream outfile; outfile.open("C:\\Users\\acer\\Documents\\file4.txt",ios::ate);… Read more »