开发者

what will be the value of x? x= a++ + ++a + a++ [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Undefined Behavior and Sequence Points

What will the value of x in following line of code:- x = a++ + ++开发者_运维百科a + a++ actually compiler is giving x = 3..but how????


This is undefined behavior. Any answer is valid, up to and including crashing. It is unlikely that any particular answer will be consistent between platforms. Don't do this.


Undefined behavior, as the value of a is modified multiple time in the same statement.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜