• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

How to set a single bit?

Special K

Diamond Member
Let's suppose I have the bit string 00110011 and I want to clear the 5th bit. I could do:

00110011 &= 11101111 which will clear the 5th bit while preserving the rest. How do I do the opposite, ie. set a bit while preserving the rest? I'm sure the answer is simple but I'm just not thinking of it right now.

thanks
 
Back
Top