J
John.Doe.UK
Hi there,
If I have three unsigned char(8 bits) and I want to compare the xth bit
in each. So if I had.
a 00000000
b 10101010
c 00000000
If I wanted to get the third bit from (a) the 0th bit from (b) and
compare them and store the result in the 7th bit of (c) how could i go
about doing this.
a 000[0]0000
b [1]0101010
c 0000000[0]
0 | 1 = 1
c = 00000001
Would there be a nice function or macro that could do this. Brand new
to all the bitwise stuff.
If I have three unsigned char(8 bits) and I want to compare the xth bit
in each. So if I had.
a 00000000
b 10101010
c 00000000
If I wanted to get the third bit from (a) the 0th bit from (b) and
compare them and store the result in the 7th bit of (c) how could i go
about doing this.
a 000[0]0000
b [1]0101010
c 0000000[0]
0 | 1 = 1
c = 00000001
Would there be a nice function or macro that could do this. Brand new
to all the bitwise stuff.