stderr, stdin, stdout - standard I/O streams
#include <stdio.h> extern FILE *stderr, *stdin, *stdout;
A file with associated buffering is called a stream and is declared to be a pointer to a defined type FILE. The fopen() function creates certain descriptive data for a stream and returns a pointer to designate the stream in all further transactions. Normally, there are three open streams with constant pointers declared in the <stdio.h> header and associated with the standard open files.At program startup, three streams are predefined and need not be opened explicitly: standard input (for reading conventional input), standard output (for writing conventional output) and standard error (for writing diagnostic output). When opened, the standard error stream is not fully buffered; the standard input and standard output streams are fully buffered if and only if the stream can be determined not to refer to an interactive device.
The following symbolic values in <unistd.h> define the file descriptors that will be associated with the C-language stdin, stdout and stderr when the application is started:
- STDIN_FILENO
- Standard input value, stdin. Its value is 0.
- STDOUT_FILENO
- Standard output value, stdout. Its value is 1.
- STDERR_FILENO
- Standard error value, stderr. Its value is 2.
None.
No errors are defined.
None.
None.
None.
fclose(), feof(), ferror(), fileno(), fopen(), fread(), fseek(), getc(), gets(), popen(), printf(), putc(), puts(), read(), scanf(), setbuf(), setvbuf(), tmpfile(), ungetc(), vprintf(), <stdio.h>, <unistd.h>.