C++ Language/Type/Conversion/PromotingSmallIntegers
Appearance
Often, there are no machine-language mathematical operators for integers smaller than int
.
Consequently, the compilation result of bTermA + bTermB
where bTermA
and bTermB
are both unsigned char
will "promote" both of these two terms into int
before doing the addition.
Additional information about integer promotion (includes interactive examples)