Nested Array of structures- input from a file, simple question

I'm trying to read data in from a file and storing it in an array of nested structures. There are 4 divers each with their own set of data, but my code is only storing for the first and leaving the others blank. The loop is indeed running 4 times, but not storing. How can i fix this? Help would be much appreciated thanks.
Data sample:
KNIFE JACK
1.3 6.0 5.1 6.3 5.9 6.5
WILLIAMSON FLIP A
1.4 3.5 4.1 4.7 7.2 3.8



int i =0;
while (i < 4 && !inFile.eof())
{
getline(inFile, divers[i].diverName);
inFile >> divers[i].info.difficultyFactor;
for (int j = 0; j < 5; j++)
{
inFile >> divers[i].info.scores[j];
}
i++;
}
is it not opening the file at all try
1
2
3
4
5
6
  if (textfile.fail())
	{
		cout << "Can Not Find File\n";
		system("pause");
		exit(1);
	} 

to check for errors
The file is opening, it's storing the first data set but not any after it. KNIFE JACK
1.3 6.0 5.1 6.3 5.9 6.5 is stored but everything else is 0.
can you post all of the code
also is it a 2d array if not 'j' could be your problem
got it working, thanks though. was missing a inFile.ignore()
Ok great, and you understand how that works and everything right. The only reason I ask is because I figure its homework(Don't worry I don't care) and wanted to help as much as I can
yeah, thank you!
Topic archived. No new replies allowed.