整数提升规则(bitshift和&)

时间:2013-07-19 15:32:02

标签: c c99

#include <stdint.h>
uint8_t bitsLow;
uint16_t bitsHigh;
uint32_t statusBits;
...
bitsHigh = (statusBits >> 8) & 0xffff;
bitsLow = statusBits & 0xff;

从整数推广规则的角度看是否有任何意义 以下内容:

bitsHigh = (statusBits >> 8) & 0xffffU;
bitsLow = statusBits & 0xffU;

(据我所知,0xff或0xffff默认为整数类型)

0 个答案:

没有答案
相关问题