I'm trying to understand a snippet of code which is the following:
unsigned char state = portStates[portNumber];
int bitValue = (state >> 7) & 0x1;
It's doing a bitwise AND on the least-significant bit of
state
, right? If it returns true (ie, that bit is set), then the
number is odd. Otherwise, it's even. Am I correct?
Thanks