1 #include <stdio.h>
2
3 int main()
4 {
5 printf("**************************************************\n");
6 printf("sizeof(int) is %d\n",sizeof(int));
7 printf("sizeof(char) is %d\n",sizeof(char));
8 printf("sizeof(short) is %d\n",sizeof(short));
9 printf("**************************************************\n");
10 char str[]="Hello,world";
11 printf("char str[]='Hello,world'\n");
12 printf("sizeof(str) is %d\n",sizeof(str));
13 printf("sizeof(*str) is %d\n",sizeof(*str));
14 printf("**************************************************\n");
15 char str1[100]="Hello,world";
16 printf("char str1[100]='Hello,world'\n");
17 printf("sizeof(str1) is %d\n",sizeof(str1));
18 printf("**************************************************\n");
19 char *p=NULL;
20 printf("char *p=NULL\n");
21 printf("sizeof(p) is %d\n",sizeof(p));
22 printf("sizeof(*p) is %d\n",sizeof(*p));
23 return 0;
24 }
|