Lets say you had a byte that had bits with values like this:
01110011
and you shifted each bit to the right by 1. The result would look like this:
00111001
If the compiler shifts all the bits to the right, will the last bit (the bit holding the value of 1) go to the next byte or will it be destroyed? Also did the zero come from the previous byte or was it just added?
On unsigned integral types. On signed ones the sign bit is propagated.
Edit: Ups!
n3337 5.8.3 says: "The value of E1 >> E2 is E1 right-shifted E2 bit positions. [...] If E1 has a signed type and a negative value, the resulting value is implementation-defined."