int main()
{
int b=0,a=1;//initialize a and b
b=++a + ++a;// calculate assign the value of b
print f("%d",b);
return 0;
}
- b 的值是多少?
- 它的计算方法是什么?
This is 未定义的行为 http://en.wikipedia.org/wiki/Undefined_behavior。缺乏序列点 http://en.wikipedia.org/wiki/Sequence_point.
欲了解更多信息,请查看here https://stackoverflow.com/questions/859433/which-issues-have-you-encountered-due-to-sequence-points-in-c-and-c and 在一个语句中输出多个前后增量 https://stackoverflow.com/questions/3812850/output-of-multiple-post-and-pre-increments-in-one-statement.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)