Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Will the uchar variable automatically return to zero when it overflows? "Single chip microcomputer, 5 1, C language, electronics"
Will the uchar variable automatically return to zero when it overflows? "Single chip microcomputer, 5 1, C language, electronics"
1, if it just overflows 1, it will automatically become zero. 255 is binary11111,+1 equals 10000000, because uchar is 8 bits, the highest bit.

2.uchar is an unsigned character.

After the maximum value of 255 is exceeded, unsigned shaping will be modulo. 255+ 1=256 , 256%256=0

Another example is 280%256=24.

Yes, 255+ 1 will be equal to 0,

This number will not be less than 0 or more than 255, and the value is within the interval.

This is determined by the characteristics of unsigned data itself, as are all unsigned integers.