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
  • 31,043
  • 20
  • 111
  • 145
Saksham
  • 9,037
  • 7
  • 45
  • 73
  • 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