这问题,有时候是个困扰,抽空梳理一遍。
char->unsigned char,%d->%d,10->10,-10->(256+10)
char->int:%c->%d,'A'->65(可打印字符表对应)
short int->unsigned short int:%d->%d,12345->12345,,-12345->53191(超出下限范围,+65535)
short int->unsinged int:%u->%d,12345->12345,-12345->4294954951(超出下限范围,+4294967295)
int->unsigned->int:%d->%u,12345->12345,-12345->4294954951
signed -128~127
unsigned char 0~127
char -128~127 (一般机器=signed char)
short int -32768~32767
unsigned short int 0~65535
int (signed int) -2147483648~2147483647
unsigned int 0~4294967295