BaysideLizard 发表于 2023-6-23 21:18:41

S1E6:数据类型

#include <stdio.h>
//BaysideLizard写于2023年6月20日
#define j "ZZH"
int main()
{
        long long int i;
        float k;
       
        i = 312;
        k = 1.123456789;

        printf("size of int is %d\n",sizeof(int));
        printf("size of char is %d\n",sizeof(char));
        printf("size of flout is %d\n",sizeof(float));
        printf("size of %i is %d\n",i,sizeof(i));
        printf("size of %s is %d\n",j,sizeof(j));
        printf("size of %f is %d\n",k,sizeof(k));

}


运行结果:
size of int is 4
size of char is 1
size of flout is 4
size of 312 is 8
size of ZZH is 4
size of 1.123457 is 4

--------------------------------
Process exited after 0.005426 seconds with return value 22
请按任意键继续. . .

跟着小甲鱼学C的第二天
加油!{:10_335:}
页: [1]
查看完整版本: S1E6:数据类型