Lets say I have the following scenarios:
int i = 10;
short s = 5;
if (s == i){
do stuff...
} else if (s < i) {
do stuff...
}
When
From Type Conversions:
The set of implicit conversions on page 44, though informally stated, is exactly the set to remember for now. They're easy to remember if you notice that, as the authors say,
the `lower' type is promoted to the `higher' type,'' where theorder'' of the types is
char < short int < int < long int < float < double < long double
That rule is easy to remember - "lower to higher" - but regarding signed and unsigned integer types it doesn't help much, those are nicely explained in Oli's post. But it's easy to remember and helps you in most cases.