comment:
string is C++ type;
String^ is CLR/C++ and C# type;
const char* ---> string
1:
const char * cw= "kkkkkkkkkk";
string sw = cw;
string ---> const char*
1:
using namespace std;
string s = "kkkkk";
const char* cc = s.data();
const char* ---String^
using namespace System::Runtime::InteropServices;
1:
const char* cc = "dddddddddd";
System::String^ cmStr = gcnew System::String(cc);
2:
const char* iconData = "sjhfksssssl";
String^ temp = String(iconData).ToString();
String^ ---> const char*
1:
using namespace System::Runtime::InteropServices;
String^ className = "hhhh";
const char* ts = (char*)(Marshal::StringToHGlobalAnsi(className)).ToPointer();
String^ ---> string
1:
using namespace System::Runtime::InteropServices;
String^ className = "hhhh";
const char* ts = (char*)(Marshal::StringToHGlobalAnsi(className)).ToPointer();
string sw = ts;
string ---> String^
string sw = "shkhk";
const char* cw = sw.data();
String^ temp = String(cw).ToString();