The comma operator evaluates the left operand and discards it.
a = (b+3, b-2, b++); is the same as a = ((b+3, b-2), b++);
If we then apply the rule, we evaluate the left operand (b+3, b-2) which has no side effects, and then we discard the result leaving us with:
a = b++;
We know that b is 7. The post increment operator is used on b, so the value of the expression b++ is 7. This is what is assigned to a. The side effect of the expression b++ is that b is incremented by 1, so b is 8.
Correct. The earlier expressions are evaluated, but their values is discarded. So why use a comma operator in the real world? Because you want the side-effects of the expression. I find that they come up most in for() loops:
for (x=something, y=something_else; x < limit; ++x) ...
This code initializes x and y in the for loop.