-5
int i=c++ + c++; 

Where c is also a integer and has a value of 5. I thought the answer for this one is 12 or 11! But as it turns out it is 10. Can anyone explain? Thanks in advance..

Omer Obaid
  • 416
  • 1
  • 6
  • 24
Nakul
  • 7

1 Answers1

0

It seems to be undefined behavior. See this post for further information: Undefined behavior and sequence points

Community
  • 1
  • 1