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 _getw( int binint, FILE *fp );

Description:
    The _getw function reads a binary value of type int from the current
    position of the stream fp and increments the associated file pointer to
    point to the next unread character in the input stream.  _getw does not
    assume any special alignment of items in the stream.

    _getw is provided primarily for compatibility with previous libraries.
     Portability problems may occur with _getw because the size of an int
    and the ordering of bytes within an int differ across systems.

Returns:
    The _getw function returns the integer value read or, if a read error or
    end-of-file occurs, the error indicator is set and _getw returns  EOF.
     Since  EOF is a legitimate value to read from fp, use  ferror to verify
    that an error has occurred.

Example:
    #include <stdio.h>

    void main()
      {
        FILE *fp;
        int c;

        fp = fopen( "file", "r" );
        if( fp != NULL ) {
          while( (c = _getw( fp )) != EOF )
              _putw( c, stdout );
          fclose( fp );
        }
      }

Classification:
    WATCOM

Systems:
    All, Netware

See Also:
    ferror, fgetc, fgetchar, fgets, fopen, getc, getchar, gets, _putw,
    ungetc

See Also: ferror _putw

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