On left shift of (char) 0xff by 8 and casting it to int we get -256 or 0xffffff00. Can somebody explain why this should happen?
#include int
char is nothing but signed char. So char c = 0xFF will be -1 . When you left shift -1 by 8 bits you get -256.