3 ms·
In C or C++ you can't rely on multiple ++ in a single statement doing anything sensible.
by mark-r 9y ago
In C or C++ you can't rely on multiple ++ in a single statement doing anything sensible.
- deleted 9y ago[deleted]
- cozzyd 9y agoIn this case I think you can since I think && is a sequence point. a + a on the other hand would be undefined.
- foxhill 9y agoactually it is defined, i believe you mean sequence point - in which case multiple updates are indeed undefined. however, unless i'm mistaken, a && b && c is 3 distinct sequence points, in which case, the behaviour is in fact well-defined.