Hello all,
I am reading from one file, formatting the data and writing it to a different file in the following way:
This works for a while but often after 62 lines fgets only reads part of the data and reports and invalid parameter error. Sometimes it happens in lines other than the 62nd. The line in question is fine and is in the middle of a load of output generated by the program (all in exactly the same way).Code:char input[256]; FILE *fraw; -- initialised earlier. while (NULL != fgets(input,sizeof(input),fraw) { if (5 == sscanf(input, "** formatting selection ** )) // process data else // report error }
Can anyone spot what I have done wrong here?




Reply With Quote