if buffer1 buffer2 open result c_str The difference in line line close

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
if(buffer1 != buffer2){
r.open(result.c_str());
r << "The difference in line #" << line;
r.close();
lock = 1;
break;
}
line++;
}
f1.close();
f2.close();
if(!lock){
std::cout << "Files do not differ.";
}
return 0;