Standard IO Library
The standard library supports wchar_t types. Each class is prefixed with the W prefix. Such as
Wostream,wistream,wiostream <iostream>
Wifstream,wofstream,wfstream <fstream>
Wistringstream,wostringstream,wstringstream <sstream>
IO objects cannot be assigned or copied:
Only element types that support replication can be stored in vectors and other container classes;
The formal parameter or return type cannot be a stream type.
Condition Status: S.eof () S.fail () S.bad () S.good ()
S.setstate (flag) S.clear ()
You should use Endl to guarantee refreshing the buffer.
When input and output are bound together, any input causes the buffer associated with the output stream to be refreshed first.
The standard library has cout and Cin tied together.
The tie function can be used on Istream,ostream objects using a pointer parameter that points to the Ostream object.
Call the function to bind the argument stream to the object of the function.
Input and output of file:
Historically, the IO standard library uses a C-style string. You can call the C_STR member to get the C-style string.
If programmers want to reuse file streams to read and write to multiple files, they must close open files before reading another file, and then call clear to purge the state of the stream.