#include <stdio.h>
void main()
{
char a='s'; //字符型 1
int b=10; //整形 4
float c=1.0; //浮点形 4
double d=1.00; //浮点形 8
int *q; //指针 4
char *p; //指针 4
char str[]="he"; //字符数组 3 默认加"\0"
//p=&str;
printf("%d\n",sizeof(a));
printf("%d\n",sizeof(b));
printf("%d\n",sizeof(c));
printf("%d\n",sizeof(d));
printf("%d\n",sizeof(q));
printf("%d\n",sizeof(p));
printf("%d\n",sizeof(str));
}
void main()
{
char a='s'; //字符型 1
int b=10; //整形 4
float c=1.0; //浮点形 4
double d=1.00; //浮点形 8
int *q; //指针 4
char *p; //指针 4
char str[]="he"; //字符数组 3 默认加"\0"
//p=&str;
printf("%d\n",sizeof(a));
printf("%d\n",sizeof(b));
printf("%d\n",sizeof(c));
printf("%d\n",sizeof(d));
printf("%d\n",sizeof(q));
printf("%d\n",sizeof(p));
printf("%d\n",sizeof(str));
}