fsetpos
fsetpos is a function in the C standard I/O library that sets the file position indicator for a stream to a position previously obtained by fgetpos. It is declared in stdio.h and has the signature int fsetpos(FILE *stream, const fpos_t *pos).
The pos argument must refer to a position previously obtained from fgetpos for the same stream. The
Return value is 0 on success and nonzero on error. Possible failure conditions include an invalid stream,
Relation to fseek and ftell: fsetpos and fgetpos are designed to handle nontrivial stream state beyond a
Usage notes and examples: A typical pattern is to save the current position with fgetpos, perform other
Portability: fsetpos is broadly supported in ISO C implementations and in C++ standard libraries that expose