how to find out if a variable is signed or unsingned
问题 In C program, if an integer is signed integer , then the highest bit is 1 , otherwise 0 . Lets take char and unsigned char , the range for a signed char is -128 to 127 and unsigned char is 0 to 255 , but in fact their hexadecimal are in range of 0x00 to 0xff . My question is now if a char and unsigned char are stored in memory using 8 bits binary number, how does the computer itself know whether it is signed or unsigned ? char a = 0xff; printf("%d", a); //its result is -1. unsigned char a =