Can the type difference between constants 32768 and 0x8000 make a difference?

后端 未结 5 1898
攒了一身酷
攒了一身酷 2021-01-04 04:30

The Standard specifies that hexadecimal constants like 0x8000 (larger than fits in a signed integer) are unsigned (just like octal constants), whereas decimal constants like

5条回答
  •  伪装坚强ぢ
    2021-01-04 05:07

    Another examine not yet given: compare (with greater-than or less-than operators) -1 to both 32768 and to 0x8000. Or, for that matter, try comparing each of them for equality with an 'int' variable equal to -32768.

提交回复
热议问题