mike74 said:
It's not obvious to me that this will work for negative numbers.
Did you try attach a debugger and see for yourself?
The other part of the answer is, defined by the standard: If the conversion is between same-signed types, and the value fits into the range of the smaller type, that's what you get. So in your case, the result would be “-1”. If the value is too large to actually fit into the smaller typ, this behaviour is implementation-defined, meaning it's up to the compiler to decide what's the appropriate action to take. Typically, you will get truncation. meaning that bytes that don't fit into the smaller type are discarded. But there is no guarantee.