第二章:基础知识 面试题 4
数组基础知识
输出答案为:20,4,4 这个答案是在32位系统之下。
机器平台:X86_64 处理器
Size of char is: 1
Size of unsigned char is: 1
Size of signed char is: 1
---------------------------------------------
Size of int is: 4
Size of short is: 2
Size of long is: 8
Size of long int is: 8
Size of signed int is: 4
Size of unsigned int is: 4
Size of unsigned long int is: 8
Size of long long int is: 8
Size of unsigned long long is: 8
---------------------------------------------
Size of float is: 4
Size of double is: 8
Size of long double is: 16
---------------------------------------------
Size of (void *) is: 8
Size of (char *) is: 8
Size of (int *) is: 8
Size of (long *) is: 8
Size of (long long *) is: 8
Size of (float *) is: 8
Size of (double *) is: 8
所有指针都是占8字节
——————————————————————————
机器平台: X86_32 处理器
Size of char is: 1
Size of unsigned char is: 1
Size of signed char is: 1
---------------------------------------------
Size of int is: 4
Size of short is: 2
Size of long is: 4
Size of long int is: 4
Size of signed int is: 4
Size of unsigned int is: 4
Size of unsigned long int is: 4
Size of long long int is: 8
Size of unsigned long long is: 8
---------------------------------------------
Size of float is: 4
Size of double is: 8
Size of long double is: 8
---------------------------------------------
Size of (void *) is: 4
Size of (char *) is: 4
Size of (int *) is: 4
Size of (long *) is: 4
Size of (long long *) is: 4
Size of (float *) is: 4
Size of (double *) is: 4
所有指针都是占4字节