fputchar

write a character to stdout

Synopsis:

#include <stdio.h>
int fputchar( int c );

Description:

The fputchar() function writes the character specified by the argument c to the output stream stdout. This function is identical to the putchar() function.

The function is equivalent to:

    fputc( c, stdout );

Returns:

The fputchar() function returns the character written. If a write error occurs, the error indicator is set, and fputchar() returns EOF When an error has occurred, errno contains a value indicating the type of error that has been detected.

See also:

errno, fputc(), fputs(), putc(), putchar()

Examples:

#include <stdio.h>

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

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

Classification:

WATCOM

Systems:

All (except DOS/PM)