#include<stdio.h>
int main()
{
char a=-128;
printf("%u\n",a);
return 0;
}
注:%u为无符号十进制整数的输出
#include<stdio.h>
int main()
{
char a=-128;
//10000000000000000000000010000000
//11111111111111111111111101111111
//11111111111111111111111110000000
//char 10000000
//整型提升
//11111111111111111111111110000000-仍是补码
//由于要打印%u,则这也是原码
//11111111111111111111111110000000
printf("%u\n",a);
return 0;
}
输出: