鱼C论坛

 找回密码
 立即注册
查看: 1305|回复: 0

[作品展示] S1E6:数据类型

[复制链接]
发表于 2023-6-23 21:18:41 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. #include <stdio.h>
  2. //BaysideLizard写于2023年6月20日
  3. #define j "ZZH"
  4. int main()
  5. {
  6.         long long int i;
  7.         float k;
  8.        
  9.         i = 312;
  10.         k = 1.123456789;

  11.         printf("size of int is %d\n",sizeof(int));
  12.         printf("size of char is %d\n",sizeof(char));
  13.         printf("size of flout is %d\n",sizeof(float));
  14.         printf("size of %i is %d\n",i,sizeof(i));
  15.         printf("size of %s is %d\n",j,sizeof(j));
  16.         printf("size of %f is %d\n",k,sizeof(k));

  17. }
复制代码



运行结果:
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的第二天
加油!
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-7-8 05:15

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表