Next: , Previous: , Up: Order of Execution   [Contents][Index]


10.3 Sequence Points

There are some points in the code where C makes limited guarantees about the order of operations. These are called sequence points. Here is where they occur:

The ordering imposed by a sequence point applies locally to a limited range of code, as stated above in each case. For instance, the ordering imposed by the comma operator does not apply to code outside the operands of that comma operator. Thus, in this code,

(x = 5, foo (x)) + x * x

the sequence point of the comma operator orders x = 5 before foo (x), but x * x could be computed before or after them.


Next: Postincrement and Ordering, Previous: Associativity and Ordering, Up: Order of Execution   [Contents][Index]