++ 1 + + +我+ ++我在Java中对C [英] ++i + ++i + ++i in Java vs C
问题描述
可能重复:结果
<一href=\"http://stackoverflow.com/questions/1525187/how-do-we-explain-the-result-of-the-ex$p$pssion-xxx\">How我们解释前pression的结果(++ x)+(++ X)+(++ x)的?
块引用>INT I = 2;
I = + 1 + + + 1 + + +我;哪个更正确的? 12或C = 13,或者,如果没有正确的事情Java的结果,请详细说明。谢谢你。
解决方案有没有像更正确。它实际上是不确定的,其所谓的序列点错误。
<一href=\"http://en.wikipedia.org/wiki/Sequence_point\">http://en.wikipedia.org/wiki/Sequence_pointPossible Duplicate:
How do we explain the result of the expression (++x)+(++x)+(++x)?
int i=2; i = ++i + ++i + ++i;
Which is more correct? Java's result of 12 or C = 13. Or if not a matter of correctness, please elaborate. Thank you.
解决方案There is nothing like more correct. It is actually undefined and its called Sequence Point Error. http://en.wikipedia.org/wiki/Sequence_point
这篇关于++ 1 + + +我+ ++我在Java中对C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!