Reading from file question
i try to output this information later in the file...it works fine when i try to output it directly after these few lines of code, but near the end of the program I am getting garbage for the student first name...any suggestions or possible solutions?
PS. I think this is my first post. Go me.
Code:
int i=0;
numberofstudents=0;
rfile>>student[0].id;
while(i<SIZE && (!rfile.eof()))
{
rfile>>student[i].firstname;
rfile>>student[i].lastname;
rfile>>student[i+1].id;
numberofstudents++;
i++;
}