Original Post
Sometimes i use stringstreams for various things. However, i have never been able to reuse a stringstream for several operations. This is because iv never been able to "clear" the old junk out of the stream. stringstream::clear() simply does just not work! It seems it does nothing. Anyone know what im doing wrong? std::stringstream ss; int value = 359; ss<<value; std::string str; str = ss.str(); // this far, all is good, str = "359" // now check this out: ss.clear() // should clear ss, no? it does not. int value2 = 111; ss<<value2; std::string str2; str2 = ss.str(); // now str2 contains "359111", while it should contain just "111" if ".clear()" would actually "clear" the contents of ss.