Erm, a byte is actually 8 bits, on the Intel x86 platform and many others, at least.
It's a common problem that can be overcome by the use of bit masking and shifting. Let's suppose you wanted the first 3 bits from a char/unsigned char (8 bits):-
Code:
0 1 0 1 0 1 0 1
\___/
In order to get those bits in C, you'd read the byte in, mask it so only the top 3 bits are relevant and shift it 5 bits to the right so the bits are at the bottom and will be arithmatically correct:-
Code:
unsigned char byte, bits;
byte = getc(fp);
bits = (byte & 0xE0) >> 5;
That'll give you a value of 0 to 7 for your three bits.
You can ignore the mask and just shift if you don't need anything else from those 8 bits.