Int fseek (File * stream, long offset, int origin );
The first parameter stream is the file pointer.
The second parameter offset is the offset. positive values indicate the positive offset and negative values indicate the negative offset.
The third parameter origin is used to set the offset starting from the file. The possible values include seek_cur, seek_end, and seek_set.
Seek_set: Start of the file
Seek_cur: current location
Seek_end: End of the file
Seek_set, seek_cur, and seek_end are respectively 0, 1 and 2.
In short:
Fseek (FP, 100l, 0); move the internal pointer of the file to 100 bytes away from the beginning of the file;
Fseek (FP, 100l, 1); move the internal pointer of the file to 100 bytes away from the current position of the file;
Fseek (FP,-100l, 2); returns the internal pointer of the file to the first byte from the end of the file.