Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdio.h>
    int fsetpos( FILE *fp, fpos_t *pos );

Description:
    The fsetpos function positions the file fp according to the value of the
    object pointed to by pos, which shall be a value returned by an earlier
    call to the  fgetpos function on the same file.

Returns:
    The fsetpos function returns zero if successful, otherwise, the fsetpos
    function returns a non-zero value.  When an error has occurred,  errno
    contains a value indicating the type of error that has been detected.

Example:
    #include <stdio.h>

    void main()
      {
        FILE *fp;
        fpos_t position;
        auto char buffer[80];

        fp = fopen( "file", "r" );
        if( fp != NULL ) {
          fgetpos( fp, &position ); /* get position     */
          fgets( buffer, 80, fp );  /* read record      */
          fsetpos( fp, &position ); /* set position     */
          fgets( buffer, 80, fp );  /* read same record */
          fclose( fp );
        }
      }

Classification:
    ANSI

Systems:
    All, Netware

See Also:
    fgetpos, fopen, fseek, ftell

See Also: fgetpos fseek

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson