What happens when you assign an int to a char in C? Does it always just ignore the extra bits on the left?
Example (4 bytes int):
unsigned char c = 0
Typically, this is exactly what happens. Section 6.3.1.3 of the ISO/IEC 9899:2011 standard prescribes what has to happen in this case:
6.3.1.3 Signed and unsigned integers
60) The rules describe arithmetic on the mathematical value, not the value of a given type of expression.
Your case falls under item 2 above (since your character is declared as unsigned). In a typical computer arithmetic, the result will be exactly as you described.