Is wchar_t just a typedef of unsigned short?

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

for example, does:

wchar_t x;

translate to:

unsigned short x;
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 15:36

    For C, wchar_t is a typedef. Whether it is a synonym for unsigned int, whether it is an unsigned type at all, or whether it is 4 bytes, is implementation-defined.

    In C++, wchar_t is a distinct built-in type. Here, too, its size and signedness is implementation-defined.

提交回复
热议问题