Hi see above code. It prints the result as 12 11 10. How it is? Can you explain?Code:int main() { int i=10; void f(int,int,int); f(i++,i++,i++); return 0; } void f(int x, int y, int z) { printf("%d %d %d",x,y,z); }
Hi see above code. It prints the result as 12 11 10. How it is? Can you explain?Code:int main() { int i=10; void f(int,int,int); f(i++,i++,i++); return 0; } void f(int x, int y, int z) { printf("%d %d %d",x,y,z); }
It has undefined behaviour. Read the various items in this FAQ.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)