






























输出结果:
size of bool: 1 bytes
size of char: 1 bytes
size of unsigned char: 1 bytes
size of wchar_t: 2 bytes
size of short: 2 bytes
size of int: 4 bytes
size of unsigned int/unsigned: 4 bytes
size of size_t: 4 bytes
size of long: 4 bytes
size of unsigned long: 4 bytes
size of float: 4 bytes
size of double: 8 bytes
size of long double: 8 bytes
Truncation from const int to unsigned char, 333 will become: 77
注解:
1. wchar_t类型用于扩展字符集,如汉字和日语,这些字符不能用单个char表示
2. 一般,short类型为半个机器字(word)长,int类型为一个机器字长,long类型为一个或两个机器字长
3. 在32位机中,int类型和long类型的字长通常是相同的
4. bool类型表示真值true和假值false,0值类型代表false,任何非0的值都代表true
5. 除bool类型外,整型可以是带符号的(signed)也可以是无符号的(unsigned)
6. int,short,long都默认为带符号型
7. 对于unsigned类型来说,编译器对取值求模,取所得值