fgetpos
Stores the current position of a stream in an object
#include <stdio.h> int fgetpos ( FILE *fp, fpos_t *pos);
The fgetpos function returns a value of 0 if successful. Otherwise, the fgetpos function returns a nonzero value. If an error occurs, errno is set.
The fgetpos function stores the current position of the file pointed to by fp in the object pointed to by pos. The value stored is usable by the fsetpos function for repositioning the file to the position it had at the time of the call to fgetpos.
#include <stdio.h> main () { int completionCode; FILE *fp; fpos_t position; completionCode = fgetpos (fp, &position); completionCode = fsetpos (fp, &position); }