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
If you mean char* to std::string, you can use the constructor.
char*
char* a; std::string s(a);
Or if the string s already exist, simply write this:
string s
s=std::string(a);