Hello, i have one problem which i cannot solve. I have class functions to read from a file bit by bit and "code" it, by inverting every third bit. I want to make a class function that compares the bits from original file and "coded" file and save the result into new file, 0 for different bits and 1 for equal bits. Thank you in advance.
// Read from the file, byte-by-byte...
std::ifstream File(...);
char Pos(NULL);
while(/*Not at the end of the file...*/)
{
File.read((char*)Pos, 1);
// Test the third bit.
if(Pos &(1 << 2))
// The third bit is 1. Do something...
}