bit checking

How do you check bits in an unsigned int

eg $35 = 00110101 how would I check if the 5th bit is 0 or 1

Thanks in advance
You can use bitwise logic operators & and |

for example 6 & 2 = 2
because 110 & 010 = 010

i think you can figure out the rest for yourself.
There is an article on this: http://www.cplusplus.com/forum/articles/6782/
Topic archived. No new replies allowed.