I have this struct to hold student information:
struct student_info {
int year;
string course_name;
int course_id;
string student_name;
int student_id;
};
And I read in from the file like this:
ifstream infile ("info.txt");
while(infile >> year >> course_name >> course_id >> student_name >> student_id) {
// do stuff
}
I was wondering if there is a way to shorten the while loop condition and still be able to read in all that data? I feel like it's too long