write a character to stdout
#include <stdio.h> int fputchar( int c );
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 );
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.
errno, fputc(), fputs(), putc(), putchar()
#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 );
}
}
WATCOM
All (except DOS/PM)