The fsetpos() function moves file position indicator to the location specified by the object pointed to by position. This value must have been previously obtained through a call to the fgetpos(). After the fsetpos() is executed, the end-of-file indicator is reset. Also, any previous call to ungetc() is nullified.
#include<stdio.h> int fsetpos(FILE *stream, const fpos_t *position);
The fsetpos() returns zero on success, otherwise returns non-zero on failure.
Following c code resets the current file position indicator to the value stored in the file_loc:
© Copyright 2021. All Rights Reserved.