Hey,
Im trying to use fseek with a value input from stdin.
int fseek( FILE *fp, long offset, int origin)
So if start is say, 35, i want the printing of the file to start at position 35 from the beginning of the file. But istead it just starts from the beginning.Code:long start; . . . fseek(finp, start, SEEK_SET); while(c != '0') { c = fgetc(finp); printf("%d ", c); }
I replace variable start with values such as "5L , 7L , etc" to check fseek's validity and it works fine. I just dont know how to pass it start so it works.