Home

iostream

iostream is a header in the C++ standard library that provides facilities for input and output through streams. It declares the standard stream objects used for console I/O and defines the core streaming interfaces that enable formatted communication between programs and their I/O devices.

Standard streams defined in iostream include std::cin for input, std::cout for output, std::cerr for error reporting,

The header also supports formatting control through stream state, flags, and manipulators. Typical usage involves sending

Implementations of iostream are part of the C++ standard library and are designed to be portable across

and
std::clog
for
logging.
Wide-character
variants
(std::wcin,
std::wcout,
std::wcerr,
std::wclog)
are
provided
as
well.
These
objects
are
generally
instances
of
the
template
classes
std::basic_istream
and
std::basic_ostream,
and
they
support
chained
operations
using
the
insertion
(<<)
and
extraction
(>>)
operators.
data
to
std::cout
or
reading
from
std::cin,
with
standard
operators
overloaded
for
many
built-in
and
user-defined
types.
The
iostream
facilities
form
the
basis
for
more
specialized
streams,
including
file
streams
(provided
by
<fstream>)
and
string
streams
(provided
by
<sstream>).
compilers.
Performance
considerations
include
the
ability
to
synchronize
or
decouple
C
and
C++
standard
I/O
when
mixing
libraries;
by
default,
iostreams
may
be
synchronized
with
C
stdio
for
compatibility.