Convert a 'const wchar_t *' to 'unsigned char *'

前端 未结 3 1768
鱼传尺愫
鱼传尺愫 2021-01-19 18:41

In C++ is it possible to convert a \'const wchar_t *\' to \'unsigned char *\'?

How can I do that?

wstring dirName;
unsigned char* dirNameA = (unsigne         


        
3条回答
  •  生来不讨喜
    2021-01-19 19:16

    You need to convert character by character. There are functions like wcstombs to do this.

提交回复
热议问题