Suppose you have the following C code
unsigned char a = 1;
printf("%d\n", ~a); // prints -2
printf("%d\n", a); // prints 1
I am surprised to see -2 printed as a result of ~1 conversion:
Opposite of 0000 0001
is 1111 1110 --> anything but -2
What am i missing here? please advise