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

Code Example 1

// EXAMPLE
ostringstream osTest;
osTest << "This is the stream\n";
osTest.clear();
osTest.str("");

/* SYNTAX 
<your-stream-variable>.clear();
<your-stream-variable>.empty();
*/

/* HEADER(S) 
#include <sstream>
*/

Learn ReactJs, React Native from akashmittal.com