Hello,
I'm currently having problems reading a line of data from a file. My code is as follows :
Code:
// File "systime.dat" contain the latest system time in for form time_t x = time(NULL);
// File "primary.dat" contains the same, except done a few minutes before.
fin.open("systime.dat");
if(!fin) cout << "LOAD ERROR" << endl;
else cout << "LOADED FINE" << endl;
fin >> y;
fin.close();
fin.open("primary.dat");
if(!fin) cout << "LOAD ERROR 2" << endl;
else cout << "LOADED FINE 2" << endl;
fin >> r;
fin.close();
cout << "Y = " << y << ", R = " << r;
cin.get();
This is my debugging function, and tells me where my problem is. My output is this :
Code:
Y = 1109850952, R = 0
I should get :
Code:
Y= 1109850952, R = 1109850743
I'm using the same method to access these, both r and y are time_t values... I simply don't see what's wrong. Can anybody see what's wrong ?
Thank you,
Korhedron