How to convert Platform::String to char*?

后端 未结 5 1309
长情又很酷
长情又很酷 2020-12-01 23:53

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 ju

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 00:07

    There's the String::Data method returning const char16*, which is the raw unicode string.

    Conversion from unicode to ascii or whatever, i.e. char16* to char*, is a different matter. You probably don't need it since most methods have their wchar versions these days.

提交回复
热议问题