adspace
Which bit wise operator is suitable for turning off a particular bit in a number?
Answer Posted / Braj Mohan Munduia
The bitwise NOT (~) operator or the bitwise AND with ones complement (& ~mask) can be used to turn off a particular bit in a number. If you want to clear the n-th bit, you would perform a bitwise AND with a mask that has a 1 in every position except for the n-th position.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers