I wonder how C++ behaves in this case:
char variable = 127;
variable++;
In this case, variable now equals to -128. However did the increment op
An overflow occured and results in undefined behavior.
Section 5.5:
Ifduring the evaluation of an expression, the result is not mathematically defined or not in the range of representable values for its type, the behavior is undefined [...]
The standard goes on to note that integer overflows are, in most implementations, ignored. But this doesn't represent a guarantee.