This invokes undefined behavior, which means that anything can happen in your program.
See the C99 spec, specifically J.2 Undefined Behavior:
The behavior is undefined in the following circumstances: [...]
- Between two sequence points, an object is modified more than once, or is modified and the prior value is read other than to determine the value to be stored (6.5).
As a rule of thumb, "between two sequence points" means between two semicolons (;
) that end a statement. The "object" mentioned in the excerpt is the variable c
.
With that out of the way, we can clearly see that the object is modified twice between two sequence points. It's modified once during the evaluation of the expression c++
and once during the assignment.