One byte at a time is the smallest amount one can read from a file.
So, you can read a byte at the time and store it an a char
variable.
Then, you can extract the bits
of the byte
, by using bitwise operators <<
and >>
.
[EDIT]
Answering to the comment:
Read byte by byte from file in C++.
Also, you might want to take a look at the ifstream reference.