In an expression, C++ makes two kinds of automatic conversion. 1)
Some type are automatically converted whenever they occur. 2) Some
type are converted when they are combined with other types in an
expression.
C++ converts bool, char, unsighed char, signed char and short to int.
Because int type is generally chosen to be the computer’s most natural
type. It can does calculations faster for that type. It’s called integerpromotions.
unsigned short convert to int if short is shorter than int, if they have the
same size. unsigned short convert to unsigned int. So no data loss in
promoting.
When an operation involves two types, the smaller is converted to the larger.
Adding an int to a float, int is converted to float type. (You have to do it,
because two types have the different inside representations)