fsetpos function(Set File Position) in C Language – example and detail

In the C Programming Language, the fsetpos characteristic units the file role indicator for the circulate pointed to via stream.


The syntax for the fsetpos characteristic in the C Language is:

int fsetpos(FILE *stream, const fpos_t *pos);

Parameters or Arguments

stream The movement whose file function indicator is to be modified. pos The file role to set for circulation (which used to be received by way of a preceding name to the fgetpos function).


The fsetpos function returns zero if successful. If an error occurs, the fsetpos function will return a nonzero fee and updates errno.

Required Header

In the C Language, the required header for the fsetpos function is:

#include <stdio.h>

Applies To

In the C Language, the fsetpos feature can be used in the following versions:

ANSI/ISO 9899-1990

Similar Functions

Other C features that are similar to the fsetpos function:

fseek characteristic rewind feature

See Also

Other C functions that are noteworthy when dealing with the fsetpos function:

fgetpos feature ftell feature