Bit Manipulation/Mask Flashcards
Review bit masking
1
Q
What is the result of the following C operation?
Write your answer in hexadecimal. 0x5B ^ 0xC2
A
Answer: 0x99
0x5B == 0101 1011
0xC2 == 1100 0010
——————————-
0x99 == 1001 1001
2
Q
What is the result of the following C operation?
Write your answer in hexadecimal. 0x5B&0xC2
A
Answer: 0x42
0x5B == 0101 1011
0xC2 == 1100 0010
——————————-
0x42 == 0100 0010