ostringstream s;
s << "123";
cout << s.str().c_str() << endl;
// how to clear ostringstream here?
s << "456";
cout << s.str().c_str() << endl;
Выход:
123 123456
Мне нужно:
123 456
Как я могу reset ostringstream получить желаемый результат?