Quote:Original post by TriencoQuote:Original post by SiCrane
Another example is a function call: all arguments to the function call must be evaluated before the function is actually called. So if you have foo(++a, ++b), you know that both ++a and ++b were both evaluated before foo() was called.
Just to add one more: while you can be sure that they will be evaluated before the function call, you can't be sure about the order. So doing something like foo(a,++a) and relying on a left to right order isn't a good idea (and real fun to debug when differently optimized builds or builds from different compilers behave differently).
I'm assuming the order its evaluated is based on the calling convention of that function. I'm sure this isn't guarenteed in the standard but it makes sense from a compiler point of view.