I'm reading about bit input/output on this link:
Bit input/output
It says:
But then:AND, if the bit from the second parameter is 1, the bit from the first one is not modified. If it's 0, it will be changed to 0. We use to clear bits we don't care about.
So...For example if we only care about the rightmost bit, but the other ones could be non zero, we use AND. "011010" AND "000001", result: "000001".
011010
000001
---------
000001
Am I missing something? How come 0&1 is 1 is it's been stated that "if the bit from the second parameter is 1, the bit from the first one is not modified."?
oh and btw, sorry if this is the wrong section to post it