各种字符串转换

System::String^转换为char*

char* ch= (char*)(void*)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(str);

将char*转换为System::String^
String^ str= System::Runtime::InteropServices::Marshal::PtrToStringAnsi((IntPtr)ch);

Posted in Cli

发表回复

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理