I'm pretty new to bit manipulators and I have a quick question. Say I've got a byte set to something like "10110101" and I want to set the the 3rd bit to 0. I know I need to XAND it with the byte "11011111" but I'm not sure of the easiest way to do this in a program. I can't just write:
can I? Is there an easy way to write it simply like this or do I need to calculate out what the base-10 value of 11011111 is and instead XAND it with that? Basically I want to end up writing a function that will set a particular specified bit to zero.Code:// x is equal to an arbitrary byte and I want to set the third bit to zero x &= 11011111;