关于原码与补码
#include <stdio.h>unsigned int getbits(unsigned int value)/*补码函数*/
{
unsigned int z;
z=value&0x100000;
if(z==0x0100000)
z=~value+1;
else
z=value;
return z;
}
void main()
{
unsigned int a;
unsigned int getbits();
printf("请输入一个八进制数: ");
scanf("%o",&a);
printf("它的补码是: %o\n",getbits(a));
}
z=value&0x100000;这句话是什么意思啊?小弟不懂,请高人指点一下!谢谢了