It is undefined to read/write non-POD data in the manner that you are doing.
The easiest method would be to write the information in text mode instead
of unformatted. If you want to read...