I want to convert std::string into a const wchar_t *

后端 未结 4 1844
深忆病人
深忆病人 2020-11-28 08:44

Is there any method? My computer is AMD64.

::std::string str;
BOOL loadU(const wchar_t* lpszPathName, int flag = 0);

When I used:

4条回答
  •  余生分开走
    2020-11-28 09:10

    If you are on Linux/Unix have a look at mbstowcs() and wcstombs() defined in GNU C (from ISO C 90).

    • mbs stand for "Multi Bytes String" and is basically the usual zero terminated C string.

    • wcs stand for Wide Char String and is an array of wchar_t.

    For more background details on wide chars have a look at glibc documentation here.

提交回复
热议问题