Why result of unsigned char << unsigned char is not unsigned char
I'm getting results from left shift to which I could not find an explanation. unsigned char value = 0xff; // 1111 1111 unsigned char = 0x01; // 0000 0001 std::cout << "SIZEOF value " << sizeof(value) << "\n"; // prints 1 as expected std::cout << "SIZEOF shift " << sizeof(shift) << "\n"; // prints 1 as expected std::cout << "result " << (value << shift) << "\n"; // prints 510 ??? std::cout << "SIZEOF result " << sizeof(value << shift) << "\n"; // prints 4 ??? I was expecting result to be 1111 1110 but instead I get int (?) with value of 1 1111 1110 . How can the bits of an unsigned char be