why is char's sign-ness not defined in C?

前端 未结 5 1300
走了就别回头了
走了就别回头了 2020-12-06 16:19

The C standard states:

ISO/IEC 9899:1999, 6.2.5.15 (p. 49)

The three types char, signed char, and unsigned char are collectively called th

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 16:48

    I suppose (out of the top of my head) that their thinking was along the following lines:

    If you care about the sign of char (using it as a byte) you should explicitly choose signed or unsigned char.

提交回复
热议问题