What is the difference between signed and unsigned variables?

后端 未结 8 1022
一个人的身影
一个人的身影 2020-12-07 13:04

I have seen these mentioned in the context of C and C++, but what is the difference between signed and unsigned variables?

8条回答
  •  自闭症患者
    2020-12-07 13:46

    unsigned is used when ur value must be positive, no negative value here, if signed for int range -32768 to +32767 if unsigned for int range 0 to 65535

提交回复
热议问题