1

I was trying out some random programs to strengthen my basic knowlege. I executed 2 statements:

int i = 4;
cout<<i++*i++;  //returned 16
cout<<i++*++i;  //returned 25

Can I please get an explanation of what is happening behind the scene?

Thanks in advance!

zurfyx
  • 27,640
  • 18
  • 109
  • 139
Saksham
  • 8,705
  • 6
  • 42
  • 67
  • 3
    This is [undefined behavior](http://stackoverflow.com/questions/4176328/undefined-behavior-and-sequence-points), there is no determinant output. – David G Feb 16 '13 at 15:41
  • 2
    ... plus this is not about the cout operator precedence, but about the ++ operator. – ALOToverflow Feb 16 '13 at 15:42

0 Answers0