TITLE: More than you want to know about ostreams and freezing RESPONSE: gregc@eagle.fsl.noaa.gov (Greg Compestine) ... The real problem: once I've collected the data from the ostrstream buffer, I'd like to discard it and empty the buffer. ... RESPONSE: steve@taumet.com (Steve Clamage) ... Rewind the stream, and you will start writing at its beginning again. Use the seekoff or seekpos functions from the streambuf. ... RESPONSE: gregc@eagle.fsl.noaa.gov (Greg Compestine) ... Your solution does reset the pointer to the beginning of the buffer, but in the following test case, additional insert operations on that buffer only overwrite the data at the beginning. Even worse, according to the ostrstream documentation, the results of the third insert operation I perform is undefined because the buffer array is 'frozen' because its after a call to the str() method, and ostrstream offers no direct way of unfreezing it. RESPONSE: steve@taumet.com (Steve Clamage) Yes it does: s.rdbuf()->freeze(0); // unfreeze strstream s This assumes you want an expandable buffer. If you supply your own buffer to the strstream constructor, freezing is irrelevent. Of course, you have to be sure you don't write off the end of it! Freezing just means the buffer will not be automatically deleted, and thus also cannot be expanded. The "undefined" caution is because you might write past the end of the frozen (and unchangeable) buffer. If you unfreeze the buffer, you also must recognize that the pointer obtained from any previous call to str() may become invalid.