It does not make sense for this to work in debug mode; that must be a mis-observation.
WCHAR
is a Microsoft alias for wchar_t
(or unsigned short
if needs be) (ref).
You have an array of these things.
Said array will never be compatible with const char*
, because wchar_t
and char
are two different things. So, you cannot pass your array to functions that require const char*
, like strcmp
.
C (and, by extension, C++) also provides a wide-character version of strcmp
that you can use: wcscmp.