Check out example codes for "c++ empty stream". It will help you in understanding the concepts better.

Code Example 1

// headers
#include <sstream>

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

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

Learn ReactJs, React Native from akashmittal.com