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
Check the different constructors of the string class: documentation You maybe interested in:
//string(char* s) std::string str(cstring);
And:
//string(char* s, size_t n) std::string str(cstring, len_str);