ostringstream s;
s << "123";
cout << s.str().c_str() << endl;
// how to clear ostringstream here?
s << "456";
cout << s.str().c_str() << endl;
Output is:
123 123456
I need:
123 456
How can I reset ostringstream to get desired output?