here's the code that I have for now:
PHP Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main() {
ifstream infile, infile2;
infile.open("pdf1.txt");
infile2.open("pdf2.txt");
if (!infile) {
cout << "Error in reading pdf1.txt" << endl;
exit(1);
}
if (!infile2) {
cout << "Error in reading pdf2.txt" << endl;
exit(1);
}
string r = infile.read();
string r2 = infile2.read();
while (infile.read() != null) {
if (r != r2) {
cout << "Different at " << r << endl;
}
infile.read();
}
return 0;
}
I want it to read it line by line, but also have the ability to tokenize (in java lol..) something, please help me where should I look for this information and suggestion to what do I need to do to read a file and compare it to other file.
I want to compare one file with the other to see if they're the same because there's going to be a server backup at my workplace, so we have to make sure if we still have the same data from the previous server.