The istrstreamand ostrstreamclasses can be used to read and write from
character arrays, these classes operate in the same way as the sscanfand
sprintffunctions in stdio
The first parameter to their constructors is a pointer to the character
array, and the second parameter is the size of the array. The array must
be allocated before the constructor is called
In the case of an ostrstream, an end-of-filecondition is signalled when the
end of the string is reached. An ostrstreamwill not overwrite the end of
the character array that it is passed
The istrstream class expects a NULL terminated character string. It
extracts characters from this string as it reads. Again an end of file will
be signalled when the end of the string is reached
All the istreamand ostreamfunctions can be performed on these classes
|