Consider an expression which evaluates "--x" twice. Do the two expressions evaluate to 99 and 98 (as in the printf example) or to 98 and 98 (as in the addition example) ? There is no steadfast language-level rule for this, because the language standard has explicitly mentioned that such constructs are illegal. In short, don't use them, because there's no way to tell reliably what will happen.
Sangha Im:
Your explanation is wrong. Such a level of incorrectness as the one in your reply can only come from someone who is utterly ignorant of the notion of
sequence points. Because of this, you are not a reliable source of information for order-of-evaluation and side-effect resolution in C and C++. I will politely suggest that you get a clue about this area of programming by reading the link OrangyTang provided (quoted above for your viewing pleasure) and all its cited sources.
Quote:This is not undefined behavior. lol...
You've just described two situations which evaluated '--x' twice. In the first, the result is 99 and 98, while in the second it is 98 and 98. How can you call this defined?