+ 1
How this program runs?? I don't know how 3 3 1 prints out..Please can u explain this code?..
Here is the code #include <stdio.h> int main() { int a=1; printf ("%d %d %d",a,++a,a++); //Output is 3 3 1 //How???? return 0; }
2 odpowiedzi
+ 2
Don't try to analyze them. Multiple postfix/prefix increment operators used between two sequence points, cause undefined behavior. The results are compiler dependent.
https://stackoverflow.com/questions/949433/why-are-these-constructs-using-pre-and-post-increment-undefined-behavior
+ 1
thanks...