I know that if you want to read a certain bit of a field you can make a mask such as 00000001, and then to read the rightmost bit you could do:
x |= y; where y is the mask and x is the bit pattern (8 bits long)
but what does the following code do:
x &= ~y;
I have seen it used before but wasn't sure exactly what it was used for. This is all using C, btw.
x |= y; where y is the mask and x is the bit pattern (8 bits long)
but what does the following code do:
x &= ~y;
I have seen it used before but wasn't sure exactly what it was used for. This is all using C, btw.