fseek function — Changes file position
int fseek(FILE* stream, long int offset, int origin)
The fseek
function seeks to
a different position in stream
.
The origin
must be one of
SEEK_CUR
, SEEK_END
, or SEEK_SET
. The offset
is relative to the current
position, end-of-file, or start-of-file, respectively. The
end-of-file flag is cleared, and any ungetc
character is also cleared.
Use fsetpos
instead of
fseek
when using large files—that
is, for which a position does not necessarily fit into a long int
.
The return value is 0
for
success or nonzero for an error.