PDA

View Full Version : ComboS[]



Praethus
09-21-2007, 02:30 PM
What is the easiest way to access the individual bits in the 4bit value this function returns?

Example: I want to know if the 2nd bit is a 0. How can this be done without a lot of if statements?

Saffith
09-26-2007, 09:39 AM
Bitwise AND.
Screen->ComboS[n] & 0010b
It's been a while, but I think that's the right syntax. The result of that will be 0 if the bit is 0 and 10b if it's not.

Praethus
09-26-2007, 06:27 PM
Bitwise and.... *smacks forehead*. Thank you very much.