Quantcast
Channel: Why are these constructs using pre and post-increment undefined behavior? - Stack Overflow
Viewing all articles
Browse latest Browse all 16

Answer by Christoph for Why are these constructs using pre and post-increment undefined behavior?

$
0
0

I think the relevant parts of the C99 standard are 6.5 Expressions, §2

Between the previous and next sequence point an object shall have its stored value modified at most once by the evaluation of an expression. Furthermore, the prior value shall be read only to determine the value to be stored.

and 6.5.16 Assignment operators, §4:

The order of evaluation of the operands is unspecified. If an attempt is made to modify the result of an assignment operator or to access it after the next sequence point, the behavior is undefined.


Viewing all articles
Browse latest Browse all 16

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>