Rule: arithmetic between integers always is always done between data type int
or higher.
If an operand is of type char
, unsigned char
, short
, or
unsigned short
it is promoted to int
or higher.
Rule: When two operands are combined with an operation (such as addition), both operands must be of the same data type. Sometimes one of them must be promoted to a "higher" type. In the following list, if two operands are different types, the lowest is promoted to the highest: