getchar
Equivalent to getc with the argument stdin (function or macro)
#include <stdio.h> int getchar (void);
The getchar function or macro returns the next character from the input stream pointed to by stdin. If the stream is at end-of-file, the EOF indicator is set and getchar returns EOF. If a read error occurs, the error indicator is set and getchar returns EOF. If an error occurs, errno is set.
The getchar function or macro is equivalent to getc with the argument stdin.
#include <stdio.h> main () { FILE *fp; int c; fp = freopen ("data.fil", "r", stdin); while ( (c = getchar () ) != EOF) putchar (c); fclose (fp); }