Yes, char is usually assigned to int or unsigned int, but it can be automatically calculated using characters if the interpreter can prove that the result will be the same:
Quote from the standard, 5.1.2.3 Program execution
11 EXAMPLE 2 When executing a fragment
char c1, c2; c1 = c1 + c2;
"whole stocks" require an abstract machine to contribute to the value of each variable in int size, then add two ints and truncate the sum.
Provided the addition of two chars can be done without Β§5.1.2.3 Environment 15ISO/IEC 9899:201x Committee Draft β April 12, 2011 N1570 overο¬ow, or with overο¬ow wrapping silently to produce the correct result, the actual execution need only produce the same result, possibly omitting the promotions .
alinsoar
source share