I have been having some trouble to understand this operation and why it gives the result it gives
int x = 5;
std::cout<<++x*x--<<std::endl;
Why is the result 30 and not 36? Isn't it supposed to perform (++x) first so we have 6 and then (x--) which is post decrement, so we end up with 6*6 for a result of 36. But when I tried running this code I get 30. Can someone explain whats going on here?