class istrstream : public istream

The istrstream class supports input streams that have character arrays as a source. You must allocate a character array prior to the construction of an istrstream object. All the istream operators and functions (including seeking) can then be used on this character data.

You must be aware that there is a get pointer working behind the scenes in the attached strstreambuf class. This pointer advances as you extract fields from the stream's array. The only way you can make it go backwards is to use the istream::seekg function. If the get pointer reaches the end of the string (and sets the ios::eof flag), then you must call clear before seekg.

#include <strstrea.h>

See Also

strstreambuf, streambuf, strstream, ostrstream