Jeff Verdegan wrote:
I suppose it's so that the expression could have one consistent type, rather than having its type depend on truth of the condition.
Sorry, I kinda misread the quote (which is bad since I quoted it).... I thought one of them had mentioned a case where it depended on the order (whether 2nd or 3rd operand).
Never mind. We are all good.... and to elaborate the answer, just in case it isn't obvious.
In the first case, zero is a literal, and hence, a compile time constant. It also is representable as a char (the other operand), so, following the second point of the quote, the expression is a char type.
In the second case, following the third point of quote. To get a char and int to be the same type, the char is promoted to an int. So, the expression is an int type.
Henry