previous | start | next

Unsigned Integer Conversion

Assigning a smaller unsigned integer to a larger unsigned integer type just pads with 0 bits.

Assigning a larger unsigned integer type to a smaller unsigned integer type just deletes the leading (more signficant) bytes.

So an unsigned int will 'fit' in an unsigned char only if the most significant three bytes are all 0's.



previous | start | next