usually you can write a function called serialize () and then have something like this:
ofstream outFile; outFile.open (dirFileString.c_str(), ios::binary); outFile.write (reinterpret_cast < char *>(&x), sizeof (x)); outFile.write (reinterpret_cast < char *>(&y), sizeof (y));
and then perform a similar function:
inFile.read (reinterpret_cast < char *>(&x), sizeof (x)); inFile.read (reinterpret_cast < char *>(&y), sizeof (y));
You can do such things for as many variables as possible inside the class object. Greetings.
Ben j source share