Can u please tell me how do we obtain the result asCode:printf("%d %d %d \n",++i,i++,--i);
6 4 6....
Ofcourse , its been evaluated using a stack...but please tell me how...with an explanation.
I am not able to understand the evaluation method...
Can u please tell me how do we obtain the result asCode:printf("%d %d %d \n",++i,i++,--i);
6 4 6....
Ofcourse , its been evaluated using a stack...but please tell me how...with an explanation.
I am not able to understand the evaluation method...
Order of evaluation of function arguments is implementation defined. Furthermore, the arguments in your example are evaluated in between consecutive sequence points, hence you are modifying i more than once between consecutive sequence points, resulting in undefined behaviour.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)