Integer Constants decimal-constant 123 Suffix Decimal Constant Octal or Hexadecimal Constant none int long int hexadecimal-constant 0 xffff int unsigned int long int unsigned long int U integer-suffix u U l L ll LL unsigned int unsigned long long int L long int long int unsigned long int UL unsinged long int unsigned long int LL long int unsigned long int ULL unsigned long int octal-constant 0644 A plus (+) or minus (-) symbol can precede an integer literal. The operator is treated as a unary operator rather than as part of the literal. 4
Convertions C 99:Conversion of an operand value to a compatible type causes no change to the value or the representation. Zero extentions 高位填充0 Signed extentions 高位填充符号位 从高精度到底精度整数转换:直接 截断取低部分!!! 当操作数为两种不同的类型时, 低rank类型的操作数被转换成高 类型的rank long double float unsigned long unsigned long unsigned int 5
Shift Logical Shift Left Logical Shift Right Arithmetic Shift Right 没有算术左移,why? 注意左边空出的所有位都填充符号位, 而不是只有最高位填充 6
Integer promotions C 99:If an int can represent all values of the original type, the value is converted to an int; otherwise, it is converted to an unsigned int. These are called the integer promotions. 48) All other types are unchanged by the integer promotions. 当char short出现在表达式中,不管有无符号,都被转换成int或者unsigned int Integer Overflow 溢出位被截断 7