Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/156.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Linux下将std::string转换为System::string? 一个非常简单的C++问题: const System::String foo = bar_C++_Mono - Fatal编程技术网

如何在Linux下将std::string转换为System::string? 一个非常简单的C++问题: const System::String foo = bar

如何在Linux下将std::string转换为System::string? 一个非常简单的C++问题: const System::String foo = bar,c++,mono,C++,Mono,其中bar是std:string 如何将bar转换为System::String?我知道已经有很多答案,但它们似乎都基于Microsoft库,例如: System::String^ result = msclr::interop::marshal_as<System::String^>(str.c_str()); System::String^result=msclr::interop::marshal_as(str.c_str()); 一、 但是,不要将封送为。我需要它在Lin

其中
bar
std:string

如何将
bar
转换为
System::String
?我知道已经有很多答案,但它们似乎都基于Microsoft库,例如:

System::String^ result = msclr::interop::marshal_as<System::String^>(str.c_str());
System::String^result=msclr::interop::marshal_as(str.c_str());
一、 但是,不要将
封送为
。我需要它在Linux(Ubuntu 20.04)下工作

BTW,我不是C++的家伙,所以这整个事情对我来说是新的。< /P>