And I don't know why. I'm a bit of a newbie to coding and I know some C/C++.
I'm playing around with classes and objects, trying to get the hang of them, so I'm trying to create a database that keeps records of students-their ID number, their first and last names, and their mark. This worked fine, until I introduced a feature to allow the user to enter an ID number to look up a student, and for some reason my program crashes after displaying "ID number " with an error message.
So, without further ado, here is my code. Sorry if I've posted more than was nessesary, but feedback on what how I've done any thing would be appreciated
Thanks in advance!
using namespace std;
cout << "Enter the pupil's first name" << endl;
cin >> fname;
cout << "Enter the pupil's last name" << endl;
cin >> lname;
cout << "Enter the studant's I.D. number" << endl;
cin >> id;
cout << "Input the pupil's mark" << endl;
cin >> mark;
cout << "I.D. \t" << id << endl;
cout << "First name\t" << fname << endl;
cout << "Last name \t" << lname << endl;
cout << "Mark \t" << mark << endl;
cout << "Enter the id number of the database you wish to view" << endl;
cin >> db;