找回密码
 注册
搜索
查看: 594|回复: 1

[ARM资料] C中enum类型的疑惑

[复制链接]
发表于 2007-12-25 09:47:45 | 显示全部楼层 |阅读模式
有关enum操作的测试小程序:
#include <stdio.h>
void main()
{
       enum test{ Max=9,Min=2} test1;
       int i=1;
       test1=(enum test)i;  
       printf("test1=%d",test1);

}
输出结果为:   test1=1   
   枚举变量的取值可以在枚举元素值的范围之外!??  请高手指点一二,谢过先.
发表于 2007-12-25 11:02:12 | 显示全部楼层
我不说。
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-10-7 14:28 , Processed in 0.046328 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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