[Previous]
[Contents]
[Next]

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. It's equivalent to:

    fputc( c, stdout );

Returns:

The character written, or EOF if a write error occurs. If an error occurs, errno indicates the type of error detected.

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

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

errno, ferror(), fopen(), fputc(), fputs(), putc(), putchar(), puts()


[Previous]
[Contents]
[Next]