how to print signed hex in c

前端 未结 3 2015
醉酒成梦
醉酒成梦 2020-12-18 19:46

I know we can use printf(\"%04X\", value); to print unsigned hex values

is there a similar flag or a function in c that you can use to print signed hex values?

3条回答
  •  我在风中等你
    2020-12-18 20:18

    What do you mean by a "signed" hexadecimal value? Do you want something like "-e0"? If so, what would that mean? The sign is already represented in the hexadecimal display, since it shows all the bits and that's all the information that's in the number.

提交回复
热议问题