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 putc( int c, FILE *fp );
    #include <stdio.h>
    #include <wchar.h>
    wint_t putwc( wint_t c, FILE *fp );

Description:
    The putc function is equivalent to  fputc, except it may be implemented
    as a macro.  The putc function writes the character specified by the
    argument c to the output stream designated by fp.

    The putwc function is identical to putc except that it converts the wide
    character specified by c to a multibyte character and writes it to the
    output stream.

Returns:
    The putc function returns the character written or, if a write error
    occurs, the error indicator is set and putc returns  EOF.

    The putwc function returns the wide character written or, if a write
    error occurs, the error indicator is set and putc returns  WEOF.

    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;
        int c;

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

Classification:
    putc is ANSI, putwc is ANSI

Systems:
     putc - All, Netware

    putwc - All

See Also:
    fopen, fputc, fputchar, fputs, putchar, puts, ferror

See Also: ferror

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