我有一个标准的库字符串,我想进行以下转换:
System::String^到std::string
发布于 2019-01-10 08:59:20
将std::string转换为System::String^的代码片段
#include <msclr/marshal.h>
std::string str = "Hello World";
System::String^ result = msclr::interop::marshal_as<System::String^>(str.c_str());将System::String^转换为std::string的代码片段
#include <msclr/marshal.h>
System::String^ str = "Hello World";
std::string result = msclr::interop::marshal_as<std::string>(str);https://stackoverflow.com/questions/54120549
复制相似问题