参考博客:https://blog.csdn.net/jiajiayouba/article/details/9297815
一、基本概念(以int为例)
有符号类型:signed int(默认就写int ,所以一般情况下都是默认是有符号类型的),取值范围:-2147483648 ~ 2147483647
无符号类型:unsigned int ,这个的取值范围:0 ~ 4294967295
目前使用的原则就是:涉及到负数就使用有符号类型的,只有正数,就可以使用无符号类型的,但是大神们说一般都要尽量
避免使用unsigned (无符号类型的数),目的是为了避免麻烦
二、一般使用无符号类型的数
1、unsigned char和 unsigned short使用较多
2、以unsigned char来为例,
unsigned char 表示的范围(0~255)
char 表示的范围是(-128~127)