Previous Page
Next Page


Sets a file position indicator to a previously recorded position

#include <stdio.h>
int fsetpos ( FILE *fp , const fpos_t *ppos  );

The fsetpos( ) function sets the file position indicator for the file specified by the FILE pointer argument. The ppos argument, a pointer to the value of the new position, typically points to a value obtained by calling the fgetpos( ) function.

The function returns 0 if successful. If an error occurs, fsetpos( ) returns a nonzero value and sets the errno variable to an appropriate positive value.

The type fpos_t is defined in stdio.h, and may or may not be an integer type.


See the example for fgetpos( ) in this chapter.

See Also

fgetpos( ), fseek( ), ftell( ), rewind( )

Previous Page
Next Page