std::string ConvertToString(System::String^ str)
{
int q=(int)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(str);
char* p=(char*)q;
return std::string(p);
}
String^ str = gcnew String(s.c_str());
简单的System::String和std::string的转换
{
int q=(int)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(str);
char* p=(char*)q;
return std::string(p);
}
String^ str = gcnew String(s.c_str());
简单的System::String和std::string的转换