C primer plus 第六版示例与我输入后的显示结果不同
各位同学大神们,我学习类型大小的时候,完全按照书中的示例程序输入到电脑,可是输出结果和书上不同,如下://打印类型的大小
#include<stdio.h>
int main(void)
{
printf("Type int has a size of %zd bytes.\n", sizeof(int));
printf("Type char has a size of %zd bytes.\n", sizeof(char));
printf("Type long has a size of %zd bytes.\n", sizeof(long));
printf("Type long long has a size of %zd bytes.\n", sizeof(long long));
printf("Type double has a size of %zd bytes.\n", sizeof(double));
printf("Type long double has a size of %zd bytes.\n", sizeof(long double));
getchar();
return 0;
}
书中的输出结果是:
Type int has a size of 4 bytes.
Type char has a size of 1 bytes.
Type long has a size of 8 bytes.
Type long long has a size of 8 bytes.
Type double has a size of 8 bytes.
Type long double has a size of 16 bytes.
而我显示的结果却是:
Type int has a size of 4 bytes.
Type char has a size of 1 bytes.
Type long has a size of 4 bytes.
Type long long has a size of 8 bytes.
Type double has a size of 8 bytes.
Type long double has a size of 8 bytes.
各个类型我都没打错字啊。检查了好几遍了。谁有空的话请指教一下。多谢!!!