MString to std::string and back


#1

I’d like to be able to use std::string instead of MString, but I’m a C++ noob and can’t get it right.
Right now, i’m putting the MString into a const char *, but can’t get that into a std::string

I can however get back to an MString from a std::string through the const char *

I’m sure there is a better way to do this.
Any ideas?


#2
MString someStr;
std::string other = someStr.asChar();
MString someOtherStr = other.c_str();

#3

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.