I am trying to read records from a text file. What is the best way to do this? Here is what I did in my program:
sscanf(sentence,"%s%s%s%s%s%s%s%s",tempId,tempPric e,tempDate,myOffice,tempSold,tempCon,tempBed,tempA dd);
I used fgets() to get the target line of text from the text file and save it in my array "sentence". Then i use sscanf to get each piece of data, the problem is that this only works for about 4 of the data members, then it skips one and records the rest. Is this some sort of input overflow? I can't figure out how to get this to work. Is this even the best way to read a text file?