codescracker


c

C fsetpos()



« Previous Function Next Function »


fsetpos()

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.

fsetpos() Syntax

#include<stdio.h>
int fsetpos(FILE *stream, const fpos_t *position);

The fsetpos() returns zero on success, otherwise returns non-zero on failure.

fsetpos() Example

Following c code resets the current file position indicator to the value stored in the file_loc:

fsetpos(fp, &file_loc);

« Previous Function Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test