Thinking in C++ Vol 2 - Practical Programming |
Prev |
Home |
Next |
A string stream works directly with memory instead of a file
or standard output. It uses the same reading and formatting functions that you
use with cin and cout to manipulate bytes in memory. On old
computers, the memory was referred to as core, so this type of
functionality is often called in-core formatting.
The class names for string streams echo those for file
streams. If you want to create a string stream to extract characters from, you
create an istringstream. If you want to put characters into a string
stream, you create an ostringstream. All declarations for string streams
are in the standard header <sstream>. As usual, there are class templates that fit into the iostreams hierarchy, as shown in the following figure:
Thinking in C++ Vol 2 - Practical Programming |
Prev |
Home |
Next |