fseek - NAME fgetpos, fseek, fsetpos, ftell, rewind −...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
NAME fgetpos, fseek, fsetpos, ftell, rewind - reposition a stream SYNOPSIS #include <stdio.h> int fseek(FILE * stream ,long offset ,int whence ); long ftell(FILE * stream ); void rewind(FILE * stream ); int fgetpos(FILE * stream ,fpos_t * pos ); int fsetpos(FILE * stream ,fpos_t * pos ); DESCRIPTION The fseek function sets the file position indicator for the stream pointed to by stream .The newposition, measured in bytes, is obtained by adding offset bytes to the position specified by whence .I f whence is set to SEEK_SET , SEEK_CUR ,or SEEK_END ,the offset is relative tothe start of the file, the current posi- tion indicator ,orend-of-file, respectively .A successful call to the fseek function clears the end-of-file indi- cator for the stream and undoes anyeffects of the ungetc (3) function on the same stream. The ftell function obtains the current value of the file position indicator for the stream pointed to by
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/05/2009 for the course COMP 2510 taught by Professor A during the Spring '06 term at BC.

Ask a homework question - tutors are online