+ 1
#include <iostream> int main() { int i=8,j=3,x; x=i++; j=++i; cout<<x; cout<<--j<<j--<<++j; return 0;}
on running the above code output is 89119 plz explain how
2 Réponses
+ 2
It's undefined behavior.
According to the standards of C and C++ side-effects (that is, the increment in this case) can be applied in any convenient for compiler the time between two sequence points.
0
it was nicely explained here: http://stackoverflow.com/questions/3986361/behavior-of-post-increment-in-cout