C ++: Converting WCHAR to LPCWSTR - A Real Working Example

I have a situation where I need to convert this:

WCHAR path[260];

at

LPCWSTR pathAfterConversion;

How can i do this?

+4
source share
2 answers
LPCWSTR pathAfterConversion = path;

should work fine.

Please note that WCHARin fact wchar_tand LPCWSTRin fact wchar_t const*. Both are typedefs.

+11
source
pathAfterConversion = path;

No conversion required.

+2
source

Source: https://habr.com/ru/post/1534047/


All Articles