Is there any practical difference between WCHAR
and wchar_t
?
wchar_t
is a distinct type, defined by the C++ standard.
WCHAR
is nonstandard, and as far as I know, exists only on Windows. However, it is simply a typedef
(or possibly a macro) for wchar_t
, so it makes no practical difference.
Older versions of MSVC did not have wchar_t
as a first-class type—instead it was simply a typedef
for short
Most likely, Microsoft introduced WCHAR
to represent a "wide character type" across any compiler version, whether or not wchar_t
existed as a native type.
You should use wchar_t
in your code though. That's what it's for.