joe*_*joe 9 string c++-cli windows-8
你如何从char转换为Platform::String^?
文档Platform::String是在这里,但没有提到如何转换为不同的数据类型.
http://msdn.microsoft.com/en-us/library/windows/apps/hh755812(v=vs.110).aspx
xia*_*oke 11
我找到了一个转换char[]为的方法Platform::String.
char char_str[] = "Char string";
std::string s_str = std::string(char_str);
std::wstring wid_str = std::wstring(s_str.begin(), s_str.end());
const wchar_t* w_char = wid_str.c_str();
Platform::String^ p_string = ref new Platform::String(w_char);
Run Code Online (Sandbox Code Playgroud)
我希望有一种比我的方法更有效的方法.