按理说wchar_t占2个字节,在ubuntu下,代码如下:

#include <stdio.h>
#include <malloc.h>
#include <string.h>

int main()
{
    wchar_t c = 'A';
    wchar_t a[] = L"Hello!";
    printf("%d\n", sizeof(c));
    printf("%d\n", sizeof(a));

    return 0;
}

结果:

y@y-VirtualBox:~/Training$ ./test
4
28
谁能告诉我是怎么回事?