If we assign a value outside this range, the compiler assigns the remainder of that value modulo 256. Therefore, assigning –1 to an 8-bit unsigned char gives that object the value 255.
The value which is applied to modulo 256 is the value represented by the binary number. So, -1 is 255 in binary representation. So, 255 mod 256 is 255.
Share this highlighthttp://www.safaribooksonline.com/a/c-primer-fifth/4260347/