My question is rather simple, yet I cannot find an easy solution:
I have an integer greater or eqal 16, so at least 1000 in binary. I wish to flip the third bit using the bitwise NOT operator. In this case, it would be 1100.
Is there any operator which could do this? The ~-operator flips all bits as far as I know, not just one certain.
XOR with the bits that you want to flip.