Question: Let's one-byte variable char flags; be a collection of flags. Let us assume further that one of the flags occupies three bits: the 3rd, 4th,
Let's one-byte variable char flags; be a collection of flags.
Let us assume further that one of the flags occupies three bits: the 3rd, 4th, and 5th bit counting from 0 from the right.
Create a collection of C #-defines for all the values that the flag may have.
Explain with details how the flag can be
- read,
- how it can be set to one of the possible values, and
- how it can be cleared
without affecting any other flag in the flags byte.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
