P
pfemat
Hi there,
i am doing some heavy computations whose result i want to save
to harddisk. the results are in an long[nsize] array named screen
and i thought of doing
char *tmp = reinterpret_cast<char*>(screen);
for (int i=0; i<nsize; i++)
{
datafile << tmp << '\n';
}
for saving onto disk and
char* tmp = new char[nsize];
for (int i=0; i<nsize; i++)
{
datafile >> screen;
}
screen = reinterpret_cast<long*>(tmp);
afterwards i compare the screen array with an screen2 array where
the latter is filled with the data from disk. and get
screen!=screen2;
for most i.
i am reconstructing the case from memory since i worked onwards
with a workaround.
thanks in advance for any hints or comments.
Matthias
i am doing some heavy computations whose result i want to save
to harddisk. the results are in an long[nsize] array named screen
and i thought of doing
char *tmp = reinterpret_cast<char*>(screen);
for (int i=0; i<nsize; i++)
{
datafile << tmp << '\n';
}
for saving onto disk and
char* tmp = new char[nsize];
for (int i=0; i<nsize; i++)
{
datafile >> screen;
}
screen = reinterpret_cast<long*>(tmp);
afterwards i compare the screen array with an screen2 array where
the latter is filled with the data from disk. and get
screen!=screen2;
for most i.
i am reconstructing the case from memory since i worked onwards
with a workaround.
thanks in advance for any hints or comments.
Matthias