Can someone please post a simple code that would convert,
System::String^
To,
C++ std::string
I.e., I just want to assign the value of,
String^ originalString;
To,
std::string newString;
Can someone please post a simple code that would convert,
System::String^
To,
C++ std::string
I.e., I just want to assign the value of,
String^ originalString;
To,
std::string newString;
This worked for me:
Don't roll your own, use these handy (and extensible) wrappers provided by Microsoft.
For example:
I like to stay away from the marshaller.
Seems much cleaner and faster to me. No need to worry about creating and deleting a context.
Here are some conversion routines I wrote many years ago for a c++/cli project, they should still work.