Currently At: Programming Reference > C Reference > Stndard C I/O > fseek()

fseek()


Syntax:
#include <stdio.h>
int fseek( FILE *stream, long offset, int origin );


Description:
The function fseek() sets the file position data for the given stream. The origin value should have one of the following values (defined in stdio.h):

Name Explanation
SEEK_SET Seek from the start of the file
SEEK_CUR Seek from the current location
SEEK_END Seek from the end of the file


fseek() returns zero upon success, non-zero on failure. You can use fseek() to move beyond a file, but not before the beginning. Using fseek() clears the EOF flag associated with that stream.



Related Topics:
ftell(), rewind(), fopen(), fgetpos(), fsetpos()


Web Standards & Support:

Link to and support eLook.org Powered by LoadedWeb Web Hosting
Valid XHTML 1.0! Valid CSS! eLook.org FireFox Extensions