8th IO Library
1. Io Class inheritance Relationship:
2. Query iostream stream Status p280-281
V is an int, when we enter 1, ' r ', or CTRL + Z when the output is as follows:
cin.clear () can clear all error bits so that the good () returns True.
3. FStream to read and write files P284
After the initial creation of the read-in and write-out FStream objects, the fin and fout are treated as CIN and cout completely, and their operations are almost indistinguishable.
4. An unpredictable bug occurs when you read and write to the same file at the same time.
For file operations, it is also recommended to use Ifstream and ofstream for streaming objects, because if you use FStream object +app mode the bug will occur.
File mode is commonly used in 6 kinds: In out app ate trunc binary. The first 5 kinds are relatively simple, binary is in 2 binary form to manipulate the file.
Here is an example of a binary file operation:
5. String Stream object Usage P287
Istringstream usage
Input and output results:
Ostringstream usage
Operation Result:
C + + Primer Learning Summary Chapter 8th IO Library