如何清除ostringstream
     ostringstream s;
     s <<“123”;
     cout << s.str()。c_str()<< endl;
     / /如何清除ostringstream在这里?
     s“”456“;
     cout << s.str()。c_str()<< endl;
输出是:
123 123456
我需要:
123 456
我如何重置ostringstream来获得所需的输出?
s.str(""); s.clear();  第一行是需要重置string为空; 第二行是需要清除可能设置的任何错误标志。 如果你知道没有设置错误标志,或者你不关心重置它们,那么你不需要调用clear() 。 
 通常,使用新的std::ostringstream对象,而不是重复使用现有的对象,会更容易,更简洁,更直接(直接std::ostringstream ?),除非代码在已知的性能热点中使用。