C fgetpos()

The fgetpos function is used to store the current value of file position indicator in object pointed to by position. The object pointed to bye position must be of the type fpos_t.

fgetpos() Syntax

int fgetpos(FILE *stream, fpos_t *position);

fgetpos returns non-zero on error, otherwise it returns zero

fgetpos() Example

Following c code stores the current file location in file_loc :

FILE *fp;
fpos_t file_loc;
fgetpos(fp, &file_loc);

C Online Test

« Previous Function Next Function »

Like/Share Us on Facebook 😋