1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
char temp1[ENTRY_SZ];
char temp2[ENTRY_SZ];
char temp3[ENTRY_SZ];
char temp4[ENTRY_SZ];
char temp5[ENTRY_SZ];
Star* newEntry;
while (infile.getline(temp1,ENTRY_SZ, ',')
&& infile.getline(temp2,ENTRY_SZ, ',')
&& infile.getline(temp3,ENTRY_SZ, ',')
&& infile.getline(temp4,ENTRY_SZ, ',')
&& infile.getline(temp5,ENTRY_SZ, '\n') )
{
int a = atoi(temp2);
int b = atoi(temp3);
double c = atof(temp4);
double d = atof(temp5);
newEntry = new Star(temp1,a, b, c, d);
starList.AddLinkToBack(newEntry);
}
|