Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What happens if an integer variable is assigned a number that is out of its range?
What happens if an integer variable is assigned a number that is out of its range?
When assigning values to variables, they are all in binary form. If it exceeds its maximum value, it will cut off more digits than it does, leaving a low bit, assuming that an unsigned char a; is defined; 8-bit binary, if it is equal to a = 257.

The binary of 257 is 1000 000 1, so he will remove the highest bit of 1, leaving 00 000 1, and the final result is A = 000000 1 B, which is a =/kloc-0. Other types of principles. I wish you progress.