I have an input stream from a binary file. I want to create a bitset for the first 5 bits of the stream. Here is the code I have so far:
ifstream is;
is.open ("bin_file.out", ios::binary );
bitset<5> first_five_bits;
is >> first_five_bits; // always is set to default 00000