I am trying to read a file with format below. They are info of students. Data fields are separated by the percent (%) character. How do i make the program read the file with fstream? will it be able to skip % automatically?
Thank You
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
HOI, Yee So%PSYC1001%55%GEOG1016%47%POLI2107%71%ECON1210%77%FINE1001%72
TAM, Siu Wah%POLI0079%72%SOCI2001%66%PSYC2060%68%THAI1001%77%GEOG1017%69
struct course_record {
string number;
int mark;
};
struct student_record {
string name; // name of student
course_record course[5]; //courses taken by student
};