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

Description:
    The _putw function writes a binary value of type int to the current
    position of the stream fp.  _putw does not affect the alignment of items
    in the stream, nor does it assume any special alignment.

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

Returns:
    The _putw function returns the value written or, if a write error
    occurs, the error indicator is set and _putw returns  EOF.  Since  EOF
    is a legitimate value to write to 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, fopen, fputc, fputchar, fputs, putc, putchar, puts

See Also: ferror

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