How does C language calculate an integer bit and a decimal number of 16? For example, Inta = 40a & 0xff? What is the result?
The result is that only the value represented by the lowest byte of the A variable is taken. Because &; Is bitwise AND, that is, when the corresponding bits are all 1, take 1, otherwise take 0. In this problem, int a = 40 means that the binary of A in memory is 00000000000000000010/000, and the hexadecimal 0xff is11160. 0xff is 0000000000000000000000101000&; 111111,only take the last byte 00 10 1000, or decimal 40.