Is char signed or unsigned by default?

前端 未结 7 810
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-21 06:49

In the book \"Complete Reference of C\" it is mentioned that char is by default unsigned.

But I am trying to verify this with GCC as well as Visual Stud

相关标签:
7条回答
  • 2020-11-21 07:33

    According to the C standard the signedness of plain char is "implementation defined".

    In general implementors chose whichever was more efficient to implement on their architecture. On x86 systems char is generally signed. On arm systems it is generally unsigned (Apple iOS is an exception).

    0 讨论(0)
提交回复
热议问题