#include<stdio.h>

enum Season
{
spring, summer=100, fall=96, winter
}; typedef enum
{
Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday
}Weekday; int main(void)
{ char * files[] = {"f","b","d","g"}; printf("sizeof files = %d\n",sizeof(files)); printf("sizeof int = %d\n",sizeof(int)); char *p = NULL;
printf("sizeof p = %d\n",sizeof(p)); /* Season */ printf("%d \n", spring); // 0 printf("%d, %c \n", summer, summer); // 100, d printf("%d \n", fall+winter); // 193 enum Season mySeason=winter; if(winter==mySeason) printf("mySeason is winter \n"); // mySeason is winter int x=100; if(x == summer) printf("x is equal to summer\n"); // x is equal to summer printf("%d bytes\n", sizeof(spring)); // 4 bytes /* Weekday */ printf("sizeof Weekday is: %d \n", sizeof(Weekday)); //sizeof Weekday is: 4 Weekday today = Saturday; Weekday tomorrow; if(today == Monday) tomorrow = Tuesday; else tomorrow = (Weekday) (today + 1); //remember to convert from int to Weekday return 0;
}
sizeof files = 16
sizeof int = 4
sizeof p = 4
0
100, d
193
mySeason is winter
x is equal to summer
4 bytes
sizeof Weekday is: 4 Terminated with return code 0
Press any key to continue ...

最新文章

  1. js中网页区域/正文/屏幕 宽和高
  2. MySQL 5.7 并行复制实现原理与调优
  3. 再看 AspriseOCR - OCR应用开发 -20151124
  4. 2013 duilib入门简明教程 -- 总结 (20)
  5. Mac OS X 删除文件快捷键
  6. 支持nmap批量漏洞扫描的script
  7. 客户端显示Not yet reported
  8. STL 源码分析《5》---- lower_bound and upper_bound 详解
  9. 【Java基础】Java内部类
  10. js控制select数据绑定下拉列表
  11. AspNetWebApi管线中如果定义两种类型的消息处理程序(全局/路由)
  12. QTP自动化测试培训:描述编程之WebElement
  13. LAP+mysql-主从+redis
  14. 运行Chromium浏览器缺少google api密钥无法登录谷歌账号的解决办法
  15. Java内存分配以及GC
  16. IntelliJ IDEA 使用技巧
  17. Atom使用
  18. Java 中常见的各种排序算法汇总
  19. acl的基本知识点
  20. Android Activity全面解析

热门文章

  1. Python&quot;sorted()&quot;和&quot;.sort()&quot;的区别
  2. C# 私有字段前缀 _ 的设置(VS2019, .editorconfig)
  3. Python3解leetcode Count Primes
  4. C#进阶系列——WebApi 路由机制剖析:你准备好了吗? 转载https://www.cnblogs.com/landeanfen/p/5501490.html
  5. ubuntu+qt+opencv
  6. 小程序中封装base64
  7. 判断是否是NaN
  8. spring 注释
  9. Linux崩溃时启动脚本获取进程相关信息
  10. excel vlookup的使用