Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Why is it different to change char to int?
Why is it different to change char to int?
Char type variables store signed plastic data.

char a = 0x83? /* 0b 1 000011*/The highest bit of this data is1. As a signed number, the highest bit is the sign bit.

When char is converted to int, if the most significant bit of char type variable is 1, the completed byte is padded with 0xFF, otherwise it is padded with 0x00.

So when your A is converted from 0x83 bytes to int, it becomes 0xFFFFFF83.