|
发表于 2007-12-6 00:07:53
|
显示全部楼层
Post by hendric;1565741
In fact, sizeof(int)=4 and sizeof(long)=8 on gcc
On my P4, both sizeof(int) and sizeof(long) is 4
- waterzh@LittleBoy ~ $ cat test.c
- #include <stdio.h>
- main()
- {
- printf("sizeof(int)=%d, sizeof(long)=%d, sizeof(long long)=%d, sizeof(double)=%d\n",
- sizeof(int), sizeof(long), sizeof(long long), sizeof(double));
- }
- waterzh@LittleBoy ~ $ gcc test.c
- waterzh@LittleBoy ~ $ ./a.out
- sizeof(int)=4, sizeof(long)=4, sizeof(long long)=8, sizeof(double)=8
- waterzh@LittleBoy ~ $
复制代码 |
|