Four questions on std::stringstream
Greetings everyone! I have a few hopefully pretty easy questions on std::stringstream
1) How do you "reset" a stringstream so that it can be used again? I looked around on Google and found ss.str(""); (where ss is an object of type std::stringstream) but this seems like an ugly hack and I was wondering if there was a "cleaner" way to do it.
2) Is it possible to get a C style string from a stringstream? I tried ss.str().c_str() but I don't think that works.
3) How can you get the length of a stringstream? Does ss.str().length() work?
4) In the Visual Studio debugger, how can I display the contents of a stringstream? the Watch window can't seem to parse ss.str().c_str().
Thanks for the help.