Mi first step is writing a function that read entries from a book. I wrote this:
Code: Select all
while (!f.eof()) {
f.read((char *)&key, 8);
f.read((char *)&move, 2);
f.read((char *)&weight, 2);
f.read((char *)&learn, 4);
cout << key << " " << move << " " << weight << " " << learn << "\n";
cin.get();
}
Code: Select all
51ea9a62840e0e00 b70b 600 0
95e456746f1c1200 610c 800 0
4ee9d4785c581400 b30e c00 0
4ee9d4785c581400 6d0d 900 0
e4b1441b92851400 2407 400 0
000e0e84629aea51 0bb7 0006 0
It's reading the data backwards!
What am I doing wrong? Have I to read data char by char?
Thanks a lot