Originally Posted by
anon
It looks like reading the file might be almost correct as far as controlling the end is concerned (whereas using inFile.eof() definitely isn't), although it seems to suffer from the exact same drawback.
The usage of globals in this code is terrible indeed, so it is no wonder it confuses the hell out of a casual reader. No portion of code, neither main nor StudentData, makes much sense when read separately.
As to the problem, you have 4 numbers followed by a string on a line, but it appears you are trying to read 24*4 + 1 numbers in a row (in the inner loop).
Edit: Sorry, that's not quite right, although it seems that you might be trying to read 5 numbers on the first iteration.