How to convert Platform::String to char*?
问题 How do I convert the contents of a Platform::String to be used by functions that expect a char* based string? I'm assuming WinRT provides helper functions for this but I just can't find them. Thanks! 回答1: Platform::String::Data() will return a wchar_t const* pointing to the contents of the string (similar to std::wstring::c_str() ). Platform::String represents an immutable string, so there's no accessor to get a wchar_t* . You'll need to copy its contents, e.g. into a std::wstring , to make