Help! About Type Conversions
The following statement is from C Primer Plus 5th Edition.
Quote:
The char and short types are promoted to type int or, if necessary, to unsigned int whenever they appear in expressions or as function arguments.
Does it mean that even in an expression like this
Code:
c = a + b // suppose a, b and c are variables of type char
a and b is also converted to type int first, then they sum together, and finally the sum is converted to type char and assigned to c?
But I also find something on the web like this
Quote:
When two or more operands of different types appear in an expression.
which means that a and b do not need to be converted to type int.
Which one is right?