I'm having a problem with fgetpos and fsetpos when i call fsetpos twice.
the code above works correctly, however when the rewind(input); line is removed, the second fsetpos fails to do anything at all.
while(0 != fgets(buffer,100,input) && strtod(buffer,NULL) < LOWER)
while(0 != fgets(buffer,100,input) && strtod(buffer,NULL) <= upper)
At first i thoght that maybe fsetpos can only work forwards in the file, but the first fsetpos in fact works backwards, so the function must work both ways
Any ideas as to why this is happening?