我一直试图弄清楚如何在Visual Studio 2005中将字符串转换为String而没有运气。
以下是相关代码:
#include <string>
using namespace std;
#using <System.dll>
using namespace System;
string test = "a test string";
所以我试图将测试转换为String ^以在其他.NET类中使用,有人可以帮助我吗?
答案 0 :(得分:2)
String^ str = gcnew String(test)