What is evaluation order of function parameters in C?

What is evaluation order of function parameters in C?

rn

What is evaluation order of function parameters in C?

rn
rn
rn

Evaluation order of functions is compiler dependent in C. Hence, it is never safe to depend on the order of evaluation. For example, a function call like below may behave differently from one compiler to another:

rn
rn
rn

void func(int, int);
int i = 2;
func(i++, i++);

rn
rn
rn
rn

There is no guarantee in the C or the C++ standard language definitions that the increments will be evaluated in any particular order. Either of the two increments might happen first. func might get the arguments `2, 3′, or it might get `3, 2′, or even `2, 2′.

rn
 
rn

 

rn

 

c