What does signed and unsigned values mean?

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

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

\"enter

Th

9条回答
  •  爱一瞬间的悲伤
    2020-12-14 03:27

    A signed integer can represent negative numbers; unsigned cannot.

    Signed integers have undefined behavior if they overflow, while unsigned integers wrap around using modulo.

    Note that that table is incorrect. First off, it's missing the - signs (such as -128 to +127). Second, the standard does not guarantee that those types must fall within those ranges.

提交回复
热议问题