int x=10; printf("%d %d",x,x++); 的输出是 11 10 ,为什么
答案:1 悬赏:60 手机版
解决时间 2021-02-28 18:11
- 提问者网友:美人性情
- 2021-02-28 06:26
int x=10; printf("%d %d",x,x++); 的输出是 11 10 ,为什么
最佳答案
- 五星知识达人网友:怙棘
- 2021-02-28 06:34
printf内参数运算顺序C++语言标准没有进行定义,所以具体结果依赖于具体的编译器实现,讨论其取值没有意义,详见C++标准
unspecified behavior
The order in which the function designator, arguments, and subexpressions within the arguments are evaluated in a function call追问大神,这只局限于c语言……习题上的。追答一样的
C89标准是这么说的
Unspecified behavior:
The order in which the function designator and the arguments in a function call are evaluated.
也就是说printf中参数的运算顺序依旧是未定义的,具体结果依然依赖于编译器的具体实现
国产教材的谭氏习题无力吐槽,摊手
unspecified behavior
The order in which the function designator, arguments, and subexpressions within the arguments are evaluated in a function call追问大神,这只局限于c语言……习题上的。追答一样的
C89标准是这么说的
Unspecified behavior:
The order in which the function designator and the arguments in a function call are evaluated.
也就是说printf中参数的运算顺序依旧是未定义的,具体结果依然依赖于编译器的具体实现
国产教材的谭氏习题无力吐槽,摊手
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯