write a character to stdout
#include <stdio.h> int putchar( int c );
The putchar() function writes the character specified by the argument c to the output stream stdout. It's equivalent to
fputc( c, stdout );
The character written. If a write error occurs, errno is set, and putchar() returns EOF.
#include <stdio.h> void main() { FILE *fp; int c; fp = fopen( "file", "r" ); c = fgetc( fp ); while( c != EOF ) { putchar( c ); c = fgetc( fp ); } fclose( fp ); }
ANSI
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
errno, ferror(), fopen(), fputc(), fputchar(), fputs(), putc()