use of the bitwise operators to pack multiple values in one int
As the comment says, we’re going to pack the age, gender and height into 15 bits, of the format: AAAAAAAGHHHHHHH Let’s start with this part: (age << 8) To start with, age has this format: age = 00000000AAAAAAA where each A can be 0 or 1. << 8 moves the bits 8 places to the … Read more