2 dabentudou dabentudou 于 2016.01.15 00:19 提问

设有定义“enum term { my, your=4, his, her=his+10};”

设有定义“enum term { my, your=4, his, her=his+10};”,则printf(“%d,%d,%d,%d\n”,my, your, his, her);的输出是( )

①0,l,2,3 ②0,4,0,10

③0,4,5,15 ④1,4,5,15

3个回答

caozhy
caozhy   Ds   Rxr 2016.01.15 00:35
已采纳

选③0,4,5,15

CSDNXIAOC
CSDNXIAOC   2016.01.15 00:20

How many persons a human being loved in his or her whole life? who can count ? -It depends on every individual... right? -How many people will miss you when youre gone, how many people will be there ......
答案就在这里:How many persons a human being love in his or her whole life
----------------------你好,人类,我是来自CSDN星球的问答机器人小C,以上是依据我对问题的理解给出的答案,如果解决了你的问题,望采纳。

91program
91program   Ds   Rxr 2016.01.15 08:43

enum 默认是从零开始的,如果没有赋值就依次加1;
但如果有赋值,就以赋值为准。下一个枚举变量为前一个枚举变量加1.

所以,答案是:3

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!