In my program, I read in the file (here is only a test file of 200,000 data points, after which there will be millions.) Now I do this:
for (int i=0;i<n;i++) { fid.seekg(4,ios_base::cur); fid.read((char*) &x[i],8); fid.seekg(8,ios_base::cur); fid.read((char*) &y[i],8); fid.seekg(8,ios_base::cur); fid.read((char*) &z[i],8); fid.read((char*) &d[i],8); d[i] = (d[i] - p)/p; z[i] *= cc; }
Moreover, n denotes the number of points to be read.
Subsequently, I write them again using
for(int i=0;i<n;i++){ fid.write((char*) &d[i],8); fid.write((char*) &z[i],8); temp = (d[i] + 1) * p; fid.write((char*) &temp,8); }
In this case, recording is faster than the reading. (time measured using clock_t)
My question is now. I made some pretty stupid mistake while reading or can this be expected?
I am using Win XP with a magnetic disk.
your magu _
magu_ source share