Well here is what is happening now- I have figured out how to read it in- its the SENTINEL thing thats getting me. Here is my new code:
Code:
void storenames(ifstream& inputfile, playerrecords league[], int& count)
{
count=0;
inputfile >> league[count].first;
while(league[count].first != SENTINEL)
{
inputfile >> league[count].last >> league[count].idnum;
count++;
inputfile >> league[count].first;
}
for (int i=0; i < count; i++)
cout << league[i].first <<" " << league[i].last <<" " << league[i].idnum <<\
endl;
}
League is my array and list is the record. Now if i put
Code:
while(!inputfile.eof())
it will print everything in mmy data file- which is better then getting nothing- so the problem I am having it stopping at the sentinel. My data file looks like this:
Code:
joe smith 23
alice west 45
bob MILLS 82
Margaret North 5
*
45 182 210 43 170 301 -1
82 150 97 -220 178 223 300 -1
11 100 105 99 -1
5 97 100 110 123 96 108 130 112 -1
I need the first read in to stop at the *. Thats where it is giving me probelms. And I cant do league[count].first != SENTINEL because it give me an error saying i cant do that. Any suggestions?