When a C++ program begins execution, four built-in streams are automatically opened. They are listed here:
|
Stream |
Meaning |
Default Device |
|---|---|---|
|
cin |
Standard input |
Keyboard |
|
cout |
Standard output |
Screen |
|
cerr |
Standard error output |
Screen |
|
clog |
Buffered version of cerr |
Screen |
By default, the standard streams are used to communicate with the console. However, in environments that support I/O redirection (such as DOS, UNIX, and Windows), the standard streams can be redirected to other devices or files.