C++ provides the following streams for use by the programmer:

C++ string streams, as as their name suggests, are strings that act (within memory) just like an input stream (in the case of an input string stream) or like an output stream (in the case of an output string stream).

Think of a string stream object as a "way station" for some data on its way to somewhere else. For example, data may be "written" or "output" to an output string stream object in memory and then formatted or manipulated in any way you like before sending it on its way to the screen or a file. Or, as another example, data may be read in as command-line parameters, combined as a single string and used to initialize an input string stream object, after which this input string stream object can be used as the source stream for extracting and validating the data from the command line.

For further details on the relevant classes see the part of our Standard Library Reference on string streams.