std::string → System::String への変換


int main()
{
const char* p = "abcぜんかく";
std::string str = "ABC全角";
const wchar_t* wp = L"abcぜんかく";
std::wstring wstr = L"ABC全角";

System::String^ s1 = gcnew System::String( p );
System::String^ s2 = gcnew System::String( str.c_str() );
System::String^ s3 = gcnew System::String( wp );
System::String^ s4 = gcnew System::String( wstr.c_str() );

System::Console::WriteLine( s1 );
System::Console::WriteLine( s2 );
System::Console::WriteLine( s3 );
System::Console::WriteLine( s4 );
}