Platform: Linux GCC
Question:
unsigned int test_bits_1 = 0x00000001;
printf("test_bits_1 = 0x00000001, test_bits_1 << 32 = %X\n",
test_bits_1 << 32);
printf("0x01 << 32 = %X\n", 0x01 << 32);
输出结果
test_bits_1 = 0x00000001, test_bits_1 << 32 = 1
0x01 << 32 = 0
请问问题出在哪里?
我以为结果test_bits_1 << 32 = 0
程式码(Code):
unsigned int test_bits_1 = 0x00000001;
printf("test_bits_1 = 0x00000001, test_bits_1 << 32 = %X\n",
test_bits_1 << 32);
printf("0x01 << 32 = %X\n", 0x01 << 32);