What is the best way to convert a C-style string to a C++ std::string? In the past I\'ve done it using stringstreams. Is there a better way?
std::string
stringstream
You can initialise a std::string directly from a c-string:
std::string s = "i am a c string"; std::string t = std::string("i am one too");