R
Richard Tobin
Ioannis Vranos said:K&R2 mentions the following:
"printf("%d %d\n", ++n, power(2,n)); /* WRONG */
can produce different results with different compilers, depending on
whether n is incremented before power is called".
That's why I call it implementation-defined behaviour.
It's undefined behaviour, and therefore implementation dependent, but
"implementation defined" means that the implementation specifies (in
its documentation) what it does. The standard contains a list of the
behaviours that the implementation must specify, but this isn't one of
them.
-- Richard