How can I convert a \'System::String ^\' to \'const char *\' in vc++?
My code:
String ^Result1= \"C:/Users/Dev/Desktop/imag.jpg\";
Ip
This is work for me.
void MarshalString ( String ^ s, string& os ) { using namespace Runtime::InteropServices; const char* chars = (const char*)(Marshal::StringToHGlobalAnsi(s)).ToPointer(); os = chars; Marshal::FreeHGlobal(IntPtr((void*)chars)); }