Draft 2002-07-12

<iostream>

The <iostream> header declares the eight standard stream objects: cerr, cin, clog, cout, wcerr, wcin, wclog, and wcout. These objects are initialized when the first instance of ios_base::Init is constructed (or ealier), or before the main program starts.

cerr variable

Error message stream

extern ostream cerr

The cerr object is a standard output stream associated with the C stderr file. It is typically used for error messages. When the cerr object is initialized, it sets the unitbuf flag, which flushes the output buffer after every operation.

See Also

clog variable, wcerr variable, ostream in <ostream>

cin variable

Normal input stream

extern istream cin

The cin object is a standard input stream associated with the C stdin file. It is used for normal program input.

See Also

wcin variable, istream in <istream>

clog variable

Log output stream

extern ostream clog

The clog object is a standard output stream associated with the C stderr file. Unlike cerr, the clog object does not set the unitbuf flag. This makes it more suitable for writing less critical messages that are not considered normal program output, such as debugging or logging messages.

See Also

cerr variable, wclog variable, ostream in <ostream>

cout variable

Normal output stream

extern ostream cout

The cout object is a standard input stream associated with the C stdout file. It is used for normal program output.

See Also

wcout variable, ostream in <ostream>

wcerr variable

Wide error message stream

extern wostream wcerr

The wcerr object is a standard output stream associated with the C stderr file. It is typically used for error messages. When the wcerr object is initialized, it sets the unitbuf flag, which flushes the output buffer after every operation.

See Also

cerr variable, wclog variable, wostream in <ostream>

cin variable

Wide input stream

extern wistreamw cin

The wcin object is a standard input stream associated with the C stdin file. It is used for wide program input.

See Also

cin variable, wistream in <istream>

clog variable

Wide log output stream

extern wostreamw clog

The wclog object is a standard output stream associated with the C stderr file. Unlike wcerr, the wclog object does not set the unitbuf flag. This makes it more suitable for writing less critical messages that are not considered normal program output, such as debugging or logging messages.

See Also

clog variable, wcerr variable, wostream in <ostream>

cout variable

Wide output stream

extern wostream wcout

The wcout object is a standard input stream associated with the C stdout file. It is used for wide program output.

See Also

cout variable, wostream in <ostream>