S
Someonekicked
I want to save tables of integers to files.
One way to write the cells as fixed size in the file, is to use
reinterpret_cast.
Is that a bad choice, good choice? I remember once before I posted a program
using it, and some suggested that I might get errors using it.
are there any other ways to write the cells as fixed size in the file?
(knowing the cells will only contain integers).
here is how I plan to do it (without much caring about all the details),
int cell = 20;
outFile.write(reinterpret_cast<const char *> (&cell),sizeof(cell));
thx for any feedback.
One way to write the cells as fixed size in the file, is to use
reinterpret_cast.
Is that a bad choice, good choice? I remember once before I posted a program
using it, and some suggested that I might get errors using it.
are there any other ways to write the cells as fixed size in the file?
(knowing the cells will only contain integers).
here is how I plan to do it (without much caring about all the details),
int cell = 20;
outFile.write(reinterpret_cast<const char *> (&cell),sizeof(cell));
thx for any feedback.