I'm a new programmer, I just was curious and wanted to write some code that would compare two .txt files char by char and check if they are identicle.
this is the code that I wrote, Can someone help me figure out why it doesn't work?
The compiler i'm using is microsoft visual C++ ver.6.0
my compiler shows 0 errors 0 warnings, but the .exe crashes
// alfred J. Denigris
// write a program that tests if two text files are identicle.
using namespace std;
bool test(char a, char b);
char chA, chB;
while (!getA.eof() || !getB.eof())
if (test(chA, chB) == true)
cout <<" char number "<<num<<" is "<< chA << "for file a and "<< chB << " For file b. TRUE" <<endl;
cout <<" char number "<<num<<" is "<< chA << "for file a and "<< chB << " For file b. FALSE" <<endl;
cout << "end";
bool test(char a, char b)
return false; }