fgetpos

Syntax

int fgetpos(int *fileptr, int *pos)

Arguments

fileptr
Pointer to a file opened using fopen.
pos
Pointer to the current position in the file.

Return

Returns 0 if successful, otherwise non-zero and sets errno to the relevant error value. The file position pointer is stored in the (pos)? parameter.

Description

Gets the current position in the file. You can use the position pointer retrieved by this function in future calls to fsetpos.

See Also

fopen, fputs, fread, fsetpos, fclose