开发者

How to convert char * to a System::string ^ [duplicate]

This question already has answers here: 开发者_开发问答 Closed 12 years ago.

Possible Duplicate:

What is the best way to convert between char* and System::String in C++/CLI

Hello, I have a function in a c++ project using \clr something like:

int WINAPI dmtTest(char *pcertificate) 
{    
    String^ sCertificate;    
    sCertificate = pcertificate; // how can I assign pcertificate to sCertificate?
    ....
}


You can do:

String^ sCertificate;
sCertificate = gcnew String(pcertificate);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜