Format
#include <stdio.h> int fsetpos(FILE *stream, const fpos_t *pos);
Language Level: ANSI, XPG4
fsetpos moves any file position associated with stream
to a new location within the file according to the value pointed
to by pos. The value of pos was obtained by
a previous call to the fgetpos library function.
If successful, fsetpos clears the end-of-file indicator, and undoes the effect of any previous ungetc function on the same stream.
After the fsetpos call, the next operation on a stream in update mode may be input or output.
Return Value
If fsetpos successfully changes the current position of
the file, it returns 0. A nonzero return value indicates an
error.
![]()
fgetpos -- Get File Position
fseek -- Reposition File Position
ftell -- Get Current Position
rewind -- Adjust Current File Position
<stdio.h>