June 2025
Intermediate to advanced
1093 pages
33h 24m
English
If you look at the simplified class hierarchy of the stream class in Figure 27.1, starting from ios, you will find three streams for strings: istringstream, ostringstream, and stringstream. For strings means that you are reading or writing a string rather than outputting to or from a console or file.
For all three classes, you need to include the <sstream> header. These streams are well-suited for converting different data types to and from strings—again, with all the advantages of the preceding streams and their methods and manipulators. Table 27.13 lists the various string streams.
|
Stream |
Meaning |
|---|---|
|
istringstream |
Creates a string stream that can be read from. The stream is opened in ios::in mode. |
Read now
Unlock full access