-

Changes

Jump to: navigation, search

Functions HI-TECH C FSEEK

1,013 bytes added, 20:05, 31 July 2017
Created page with "<strong>FSEEK</strong> ==SYNOPSIS== #include <stdio.h> int fseek(FILE * stream, long offs, int wh) ==DESCRIPTION== <strong>Fseek</strong>() positions the "file pointer..."
<strong>FSEEK</strong>
==SYNOPSIS==

#include <stdio.h>

int fseek(FILE * stream, long offs, int wh)


==DESCRIPTION==
<strong>Fseek</strong>() positions the "file pointer" (i.e. a pointer to
the next character to be read or written) of the specified stream as follows:

{|
!wh!! resultant location
|-
| 0 || offs
|-
| 1 || offs+previous location
|-
| 2 || offs+length of file
|}

It should be noted that offs is a signed value. Thus
the 3 allowed modes give postioning relative to the
beginning of the file, the current file pointer and the
end of the file respectively. EOF is returned if the
positioning request could not be satisfied. Note however that positioning beyond the end of the file is
legal, but will result in an EOF indication if an
attempt is made to read data there. It is quite in
order to write data beyond the previous end of file.
<strong>Fseek</strong>() correctly accounts for any buffered data.

==SEE ALSO==

lseek, fopen, fclose

Navigation menu