
please wait
|
|
|
|
|
|
I still don't understand why __int8 gets converted to int when doing the bitwise operation. |
unsigned short and unsigned char are still smaller than int, but they don't behave that way |
|
|
|
|
|
|
I still don't understand why __int8 gets converted to int |
0b00000000
is an int.
Usual arithmetic conversions: The arguments of the following arithmetic operators undergo implicit conversions for the purpose of obtaining the common real type, which is the type in which the calculation is performed: binary arithmetic *, /, %, +, - relational operators <, >, <=, >=, ==, != binary bitwise arithmetic &, ^, |, the conditional operator ?: ... 4) Otherwise, both operands are integers. In that case, First of all, both operands undergo integer promotions ... Integer promotions: Integer promotion is the implicit conversion of a value of any integer type with rank less or equal to rank of int ... to the value of type int or unsigned int http://en.cppreference.com/w/c/language/conversion |
|
|