int main()
{
unsigned int a = 0xd8;
if (a & 0x80) {
a -= 1;
a = ~a;
a &= 0x7f;
a = -a;
}
printf("a %d\n", a);
return 0;
}
示例的变量为八位数
int main()
{
unsigned int a = 0xd8;
if (a & 0x80) {
a -= 1;
a = ~a;
a &= 0x7f;
a = -a;
}
printf("a %d\n", a);
return 0;
}
示例的变量为八位数