源码测试

 1 // typesize.c -- 输出类型的大小
 2 #include <stdio.h>
 3 int main(void)
 4 {
 5     //C99为类型大小提供一个%zd说明符
 6 
 7     printf("Type int has a size of %u bytes. \n", sizeof(int));
 8     printf("Type char has a size of %u bytes. \n", sizeof(char));
 9     printf("Type long has a size of %u bytes. \n", sizeof(long));
10     printf("Type double has a size of %u bytes. \n", sizeof(double));
11 
12     return 0;
13 
14 }

 

posted @ 2014-06-18 11:24  liuxia_hust  阅读(160)  评论(0编辑  收藏  举报