Consider a complete C program that calls add(&a, &b) and add(&b, &a) as arguments to printf. Each call changes an object through a side effect, but the standard does not determine which call happens first. The behavior remains defined, while the final values and printed results can differ. section 17.2
Two valid outputs
The program can print “a = 8, b = 13” or “a = 11, b = 8”. These outputs reflect different permitted orders for the two function calls, not undefined behavior. section 17.2
TAKEAWAY 17.1: Side effects in functions can lead to indeterminate results. Do not assume an evaluation order merely because a compiler accepts the program; commonly used compilers can choose differently without warning. section 17.2
