wxString myString = "Hello world!"; char* cString = myString.mb_str(); // use cString as a null-terminated C-style string
wxString myString = "Hello äöü!"; char* cString = myString.mb_str(wxConvUTF8); // use cString as a null-terminated C-style string encoded in UTF-8
wxString myString = "Hello world!"; std::string myStdstring = myString.mb_str();In this example, we create a wxString object with the value "Hello world!" and then convert it to a std::string using the mb_str function. Package/Library: wxWidgets