#include using namespace std; struct Sector { int16_t floor, ceil; char floortex[8], ceiltex[8]; int16_t light, special, tag; void print(int id) { cout << "id:" << id << " " << "floor:" << floor << " " << "ceil:" << ceil << " " << "ftex:" << floortex << " " << "ctex:" << ceiltex << " " << "light:" << light << " " << "spec:" << special << " " << "tag:" << tag << "\n"; } } sectorA, sectorB; int main(int argc, char** argv) { if (argc < 3) { std::cout << "usage: " << argv[0] << " SECTORS1.lmp SECTORS2.lmp\n"; return 1; } ifstream fileA(argv[1]), fileB(argv[2]); bool endA = false, endB = false; for (int i = 0; !(endA && endB); ++i) { if (fileA.peek() == EOF) endA = true; else fileA.read((char*)§orA, sizeof(Sector)); if (fileB.peek() == EOF) endB = true; else fileB.read((char*)§orB, sizeof(Sector)); if (memcmp(§orA, §orB, sizeof(Sector))) { if (!endA && !endB) { cout << "<<< "; sectorA.print(i); cout << ">>> "; sectorB.print(i); } else if (endB) { cout << "--- "; sectorA.print(i); } else if (endA) { cout << "+++ "; sectorB.print(i); } cout << "\n"; } } return 0; }