It is implementation-defined (i.e. up to the compiler) isif char is signed or unsigned. Also, whenever a type smaller than int is used in an arithmetic expression, it will be promoted to an int.
And since the promotion will do sign-extension a, the signed char will be promoted to the value -1, but an unsigned will be promoted to the value 255.
This is a major reason all character reading functions return an int, so they can be directly compared to the int value EOF.
Because of the implementation-defined nature of char, there are actual three different types for char, unlike all other integer types:
signed charunsigned charchar.
When a char is promoted to an int, the value needs to stay the same. So -1 is still -1, and 255 is still 255.