this is close but i can't specify an "IF" to exit. If there's an invalid float encountered it just runs into an endless loop. How do i check if it's not 4??
I ccan't repeat
since that would scan to the next line and i would miss a line...
fscanf(fp, "%d %s %s %f", &temp->empNo, temp->lastName,
temp->firstName, &temp->hourlyRate) == 4
//initalize temp node
while ( fscanf(fp, "%d %s %s %f", &temp->empNo, temp->lastName,
temp->firstName, &temp->hourlyRate) == 4)
I want to check if the file given is in the correct format in terms of INT, STRING, STRING, FLOAT otherwise i want the program to simply exit.
You want to eliminate the floats that have a non-finite decimal expansion ?