Here ya go - it's quick and nasty though!
#include <iostream>
#include <fstream>
using namespace std;
int main() {
string filename1,filename2;
cout<<"File one: ";
cin>>filename1;
ifstream inone(filename1.c_str());
cout<<"File two: ";
cin>>filename2;
ifstream intwo(filename2.c_str());
string a,b;
int n = 0;
while ((!inone.eof()) && (!intwo.eof())) {
getline(inone,a);
getline(intwo,B);
n++;
if (a != B) {
cout<<"There was a discongruity on line: "<<n<<"\n";
}
}
return 0;
}
Edit: Ugh... lost all my formatting...
Edit2: Ugh... it turned my code into smileys!
|