How do you convert LPCWSTR to const char *?

↘锁芯ラ 提交于 2019-12-29 08:38:09

问题


How do you convert LPCWSTR to const char *?

Thanks


回答1:


Use the WideCharToMultiByte function.

Note that LPCWSTR is the same as const wchar_t *, so if you're dealing with wide character data throughout your application, you may not need to convert it at all.




回答2:


You can also have a look at wcstombs_s



来源:https://stackoverflow.com/questions/4542521/how-do-you-convert-lpcwstr-to-const-char

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!