-1

I know the concept of post increment but how does it apply to the follow? The output of t is 10. How to explain the undefined behavior?

int a = 2;
int b = 3;
int t;
t = a++ * (a+b); 
MLAC
  • 129
  • 2
  • 10

1 Answers1

0

That is undefined behavior you have there.

juzzlin
  • 45,029
  • 5
  • 38
  • 50