The include header <iostream> declared input and output stream
objects. The declared objects are associated with the standard
C streams provided for by the functions in <cstdio>.
The ANSI/ISO standard calls for predetermined objects for standard input, output, logging and error reporting. This is initialized for normal and wide character formats.
Declaration of standard objects
Prototype:
Header <iostream>
namespace std{
extern istream cin;
extern ostream cout;
extern ostream cerr;
extern ostream clog;
extern wistream wcin;
extern wostream wcout;
extern wostream cerr;
extern wostream wclog;
}
All streams are buffered (by default) except cerr and wcerr.
NOTE You can change the buffering characteristic of a stream with:
cout.setf(ios_base::unitbuf); or
cerr.unsetf(ios_base::unitbuf);
Narrow stream objects provide unbuffered input and output associated with standard input and output declared in <cstdio>.
Prototype:
istream cin;Remarks:
The object cin controls input from an unbuffered stream buffer associated with
stdin declared in <cstdio>. After cin is initialized cin.tie() returns cout.
Return:
Prototype:
ostream cout;Remarks:
The object cout controls output to an unbuffered stream buffer associated with
stdout declared in <cstdio>.
Return:
Controls output to an unbuffered stream.
Prototype:
ostream cerr;Remarks:
The object cerr controls output to an unbuffered stream buffer associated with
stderr declared in <cstdio>. After err is initialized, err.flags() and unitbuf is nonzero.
Return:
Controls output to a stream buffer.
Prototype:
ostream clog;Remarks:
The object clog controls output to a stream buffer associated with cerr declared
in <cstdio>.
Return:
Narrow stream objects provide unbuffered input and output associated with standard input and output declared in <cstdio>.
Prototype:
wistream wcin;Remarks:
The object win controls input from an unbuffered stream buffer associated with
stdin declared in <cstdio>. After cin is initialized win.tie() returns wout.
Return:
Prototype:
wostream wcout;Remarks:
The object cout controls output to an unbuffered stream buffer associated with
stdout declared in <cstdio>.
Return:
Controls output to an unbuffered stream.
Prototype:
wostream wcerr;Remarks:
The object werr controls output to an unbuffered stream buffer associated with
stderr declared in <cstdio>. After werr is initialized, werr.flags() and unitbuf is nonzero.
Return:
Controls output to a stream buffer.
Prototype:
wostream wclog;Remarks:
The object wlog controls output to a stream buffer associated with cerr declared
in <cstdio>.
Return: