What does signed and unsigned values mean?

后端 未结 9 863
旧巷少年郎
旧巷少年郎 2020-12-14 02:28

What does signed mean in C? I have this table to show:

\"enter

Th

9条回答
  •  一向
    一向 (楼主)
    2020-12-14 03:21

    A signed integer can have both negative and positive values. While a unsigned integer can only have positive values.

    For signed integers using two's complement , which is most commonly used, the range is (depending on the bit width of the integer):

    char s -> range -128-127

    Where a unsigned char have the range:

    unsigned char s -> range 0-255

提交回复
热议问题