Getting an infinite loop

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
http://www.cplusplus.com/forum/articles/40071/#msg216313
we must be able to test it, so you ought to provide the input file too.
Topic archived. No new replies allowed.