Bitwise | Sololearn: Learn to code for FREE!



Could anyone tell me what is a bit mask and how to use it in setting, clearing, and testing a bit? -Thanks!

2/10/2021 4:15:09 AM


5 Answers

New Answer


coip To set a bit, use bitwise OR operator. <mask> | = <bit> To clear a bit, use bitwise XOR operator. <mask> ^= <bit> To check a bit, use bitwise AND operator. <mask> & <bit>


Begin here 👇


I have already known about bitwise. What I am asking is about bitmask Abol Ipang but thanks.


thanks Abol