Reprinting line infinite number of times

I am writing a program for grading a multiple choice test. The test data is pulled in from another file. My problem is that its only pulling in the first line of data and running an infinite loop without reading the next line of the data file.

My code is as follows:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
PrintPurpose ( );


cout << student << " ";
cout << answers << " ";
inData >> key;
keylength = key.length();

do
{
inData >> student;
cout << student<< " ";
inData >> answers;
cout << answers << " " << endl;

}
while (!inData.eof());

return 0;
}


Thanks for any help.
Last edited on
Topic archived. No new replies allowed.