开发者

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

开发者 https://www.devze.com 2023-01-10 07:11 出处:网络
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
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

精彩评论

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

关注公众号