Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to convert a long integer into a short integer in C language? Take 80000 as an example, please elaborate.
How to convert a long integer into a short integer in C language? Take 80000 as an example, please elaborate.
It's best to say in hexadecimal:

When 80000 is converted into hexadecimal, it is 0x 13880.

Two hexadecimal numbers account for one byte, so three bytes are needed to store 0 1 38 80 respectively, while the short integer has only two bytes, so the low order is only 38 80, so if 80000 is converted into a short integer, the value is 0x3880, that is, 14460 in decimal.