get a character from stdin
#include <stdio.h> int fgetchar( void );
The fgetchar() function is equivalent to fgetc() with the argument stdin.
errno, fgetc(), getc(), getchar()
#include <stdio.h>
void main()
{
FILE *fp;
int c;
fp = freopen( "file", "r", stdin );
if( fp != NULL ) {
while( (c = fgetchar()) != EOF )
fputchar(c);
fclose( fp );
}
}
WATCOM
All (except DOS/PM)