Legal entity prospect:
I believe the correct reference in the C99 / C11 standard §6.3.1.3(with emphasis on mine):
- When a value with an integer type is converted to another integer type other than _Bool, if the value can be represented by a new type, it has not changed.
- , , , , , , .
- , ; , , .
, char , , unsigned. , , unsigned char.
:
, sizeof(int) == 4 , 53200 :
0000 0000 0000 0000 1100 1111 1101 0000
, CPU (, ), , , , , .. :
0000 1101 1111 1100 0000 0000 0000 0000
, (unsigned char) 53200 , ( ) (, , sizeof(unsigned char) == 1):
53200 - 256 - 256 - ... - 256 = 53200 % 256 = 208
1101 0000
, "", , .
printf():
@pmg printf() , - unsigned char ( signed char char) int, " ".
:
biwise & , :
*int_number & 0xff /* mask is 0000 0000 0000 0000 1111 1111 */