Re: finding color of bits



harryos wrote:

The book continues to point out that 'bits in each octect can be got
by shifting it and ANDing with a constant'.Being new to bit
manipulation etc i couldn't quite write the code.if someone can help
pls do.

Least Bit == octet >> 0 & 1
Next bit == octet >> 1 & 1
Next next bit == octet >> 2 & 1

or

Least Bit == (octet & 1) != 0
Next bit == (octet & 2) != 0
Next next bit == (octet & 4) != 0

--
pete
.