### Using Predefined Streams

In addition to giving you the facilities to define your own streams for input and output, the I/O Stream Classes also provide the following predefined streams:

- cin is the standard input stream.
  file descriptor = 0.
- cout is the standard output stream.
  file descriptor = 1.
- cerr is the standard error stream. Output to this stream is unit-buffered. Characters sent to this stream are flushed after each output operation.
  file descriptor = 2.
- clog is also an error stream, but unlike the output to cerr, the output to clog is stream-buffered. Characters sent to this stream are flushed only when the stream becomes full or when it is explicitly flushed.
  file descriptor = 2.

The predefined streams are initialized before the constructors for any static objects are called. You can use the predefined streams in the constructors for static objects.

The predefined streams cin, cerr, and clog are tied to cout. As a result, if you use cin, cerr, or clog, cout is flushed. That is, the contents of cout are sent to their ultimate consumer.

Using the cin Stream in a Class Input Operator