Is wchar_t just a typedef of unsigned short?

前端 未结 6 684
滥情空心
滥情空心 2020-12-11 14:54

for example, does:

wchar_t x;

translate to:

unsigned short x;
6条回答
  •  不知归路
    2020-12-11 15:22

    In short: in C may be in C++ no.

    Widely. C defines wchar_t as typedef but in Unix it is generally 4 bytes (so generally not short) and in Windows 2 so it may be short.

    Under C++ it is unique built-in type like char or int, so you can legally overload void foo(short x) and void foo(wchar_t x)

提交回复
热议问题