8.3. string Streams
The sstream header defines three types to support in-memory IO; these types read from or write to a string as if the string were an IO stream.
The istringstream
type reads a string, ostringstream
writes a string, and stringstream
reads and writes the string. Like the fstream types, the types defined in sstream inherit from the types we have used from the iostream header. In addition to the operations they inherit, the types defined in sstream add members to manage the string associated with the stream. These operations are listed in Table 8.5. They may be called on stringstream objects but not on the other IO types.
Table 8.5. stringstream-Specific Operations
Note that although fstream and sstream share the interface ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access