How to read bit by bit in a file
My question is that
assume that you have a file with hundred's of 0's or 1's (binary)
example:
10010101010101101
10101010101010111
.......
Now I want to read one bit at a time from that file. Is that possible?
If there was a space in between each bits then Yes I could do it by
1 2 3 4 5 6 7 8 9 10
|
long long int dataDECODER[512];
int j = 0;
ifstream inBINARY;
inBINARY.open("outBinaryFile.txt");
while(!inBINARY.eof())
{
inBINARY >> dataFILE[j];
j++;
}
|
I cannot grab the whole data into an array or a variable because the value in the file is too large.
So is there a way to do this?
Topic archived. No new replies allowed.