c#System::String转c++string

转载,点击查看原网址

#include <msclr/marshal.h>
#include <msclr/marshal_windows.h>
#include <msclr/marshal_cppstd.h>
#include <msclr/marshal_atl.t>

System::String^ pStr;//这里没有gcnew
std::string s = msclr::interop::marshal_as<std::string>(pStr->ToString())

posted @ 2022-03-22 09:32  趁着月光  阅读(14)  评论(0)    收藏  举报  来源