One of the possibilities is:
somestringstream.str("");
But is it most optimal? Is there any way to preserve stringstream internal buffer, so that following operator<<() calls would not require to reserve memory again?
question from:https://stackoverflow.com/questions/834622/best-way-to-empty-stringstream