I am working on an assignment "Text file compression" using Bitwise operators. I dunno why it isn't reading the whole file(compressed text file). Whereas simple text file is read as fine why is that?
int main()
{
ifstream inFile;
inFile.open("Compressed.txt");
int counter = 0;
inFile.seekg (0, inFile.end);
int length = inFile.tellg();
inFile.seekg (0, inFile.beg);
cout << "The real file size: " << length << "\n\n\n";
while(!inFile.eof())
{
char ch;
inFile.get(ch);
counter ++;
}
inFile.close();
cout << endl <<"Number of characters read before eof: "<< counter;
counter = 0;
inFile.open("Compressed.txt", ios_base::binary);
while(!inFile.eof())
{
char ch;
inFile.get(ch);
counter ++;
}
inFile.close();
cout << endl <<"Number of characters read before eof as a binary stream: "<< counter << endl << endl;
}