可能重复:
What is the best way to convert between char* and System::String in C++/CLI
您好, 我在使用\ clr之类的c ++项目中有一个函数:
int WINAPI dmtTest(char *pcertificate)
{
String^ sCertificate;
sCertificate = pcertificate; // how can I assign pcertificate to sCertificate?
....
}
答案 0 :(得分:17)
你可以这样做:
String^ sCertificate;
sCertificate = gcnew String(pcertificate);