2007年9月18日星期二

promotions

Before an arithmetic operation is performed,integral promotion is used to create ints out of shorter integer types.(C.6.1 Promotions)

The Boolean,character,and integer types are collectively called integral types. The integral and floating-point types are collectively called arithmetic types .(4.1.1 Fundamental Types)

unsigned long val = 0;
char a = 0x48;
char b = 0x52;
val = b << 8 | a;
A 20992 B 21064 C 72 D 0

what is the answer?

没有评论: