1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
What is fstream
and iostream
?
Data plumbing system! C++ streams create channels for information to flow between your program and the outside world (screen, files, memory). iostream
defines the basic plumbing system, while fstream
adds special connectors specifically for working with files.
ifstream file(filename)
: The constructor calls operating system functions to locate the file, check permissions, and obtain a file handle (a reference number the OS uses to track open files). Once opened, the stream object configures internal buffers to efficiently read data from disk when requested.
What is sstream
?
cio`