c++ reset stream

C++
// headers
#include <sstream>

// syntax
<stringstream-name>.clear();
<stringstream-name>.str();

// example
ostringstream oTestStrm;
oTestStrm << "Hello World!";
oTestStrm.clear();
oTestStrm.str("");

Source

Also in C++: