2.12.3.10 fseek
Declaration:
int fseek(FILE *
stream, long int
offset, int
whence);
Sets the file position of the stream to the given offset. The argument offset signifies the number of bytes to seek from the given whence position. The argumentwhence can be:
SEEK_SET | Seeks from the beginning of the file. |
SEEK_CUR | Seeks from the current position. |
SEEK_END | Seeks from the end of the file. |
On a text stream, whence should be SEEK_SET
and offset should be either zero or a value returned from ftell
.
The end-of-file indicator is reset. The error indicator is NOT reset.
On success zero is returned. On error a nonzero value is returned.