Professional Documents
Culture Documents
Calling Convention
Calling Convention
Calling Convention
int a=1;
Printf(%d %d, a++ , ++a);
In this case, if we see from right to left, first ++a is evaluated and a
becomes 2. But the value is not passed to the function. For a++, first
the value of a(2) is passed to printf function and incremented. Now
the incremented value is passed for ++a to the printf function. The
result will be 2 3.
Note :
If an expression contains more than one operator, then
precedence and associativity of operators comes into action.
int a = 1;
printf("%d %d" , a++, a = ++a - a);
If we see from right to left, in first expression contains combination
of operators. The priority order is ++,