convert from std::string to String^

From MSDN:

#include <string>
#include <iostream>
using namespace System;
using namespace std;

int main() {
   string str = "test";
   String^ newSystemString = gcnew String(str.c_str());
}

http://msdn.microsoft.com/en-us/library/ms235219.aspx

Leave a Comment