Input/Output Streams
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Input-Output Streams.
basic_iostream`, which is defined in the header file <istream>, is the class template for objects that handle both input and output character-based I/O streams.
There are two typedefs that define character-specific specializations of basic_iostream and can help make code easier to read: iostream (not to be confused with the header file <iostream>) is an I/O stream that is based on basic_iostream<char>; wiostream is an I/O stream that is based on basic_iostream<wchar_t>.
For more information, see basic_iostream Class, iostream, and wiostream.
Deriving from basic_iostream is the class template basic_fstream, which is used to stream character data to and from files.
There also are typedefs that provide character-specific specializations of basic_fstream. They are fstream, which is a file I/O stream that is based on char, and wfstream, which is a file I/O stream that is based on wchar_t. For more information, see basic_fstream Class, fstream, and wfstream. Using these typedefs requires the inclusion of the header file <fstream>.
When a |
The class template basic_stringstream and its common specialization, stringstream, are often used to work with I/O stream objects to insert and extract character data. For more information, see basic_stringstream Class.
stringstream
basic_stringstream Class
<sstream>
iostream Programming
C++ Standard Library