How to read/write arbitrary bits in C/C++

Viewed 136199

Assuming I have a byte b with the binary value of 11111111

How do I for example read a 3 bit integer value starting at the second bit or write a four bit integer value starting at the fifth bit?

8 Answers
Related