Standard Streams

Top  Previous  Next

For convenience, three file pointers are always automatically opened by tasks linked with the full library. These are declared in stdio.h as follows.

 


FILE *stdin;

the standard input stream. By default, stdin is the keyboard.


FILE *stdout;

the standard output stream. By default, stdout is the screen.


FILE *stderr;

standard error stream, used by programs for outputting error messages. It too is normally opened on the screen.

 

Files processed or created by redirecting the standard input, output and error streams are always text files. You cannot process binary files by redirecting standard input and standard output in this way.