How does expression evaluation order differ between C++ and Java?-Collection of common programming errors

When an operation has side effects, C++ relies on sequence points rule to decide when side effects (such as increments, combined assignments, etc.) have to take effect. Logical and-then/or-else (&& and ||) operators, ternary ? question mark operators, and commas create sequence points; +, -,

Originally posted 2013-11-09 23:36:48.