2buck56 wrote:
Richard, thanks for the suggestion. However, I've tried using CArchive* ar with new and delete. Even after you delete the ar pointer, you cannot re-use it. The compiler complains with the same error message. If I am going to have to create 2 objects anyway, I might as well use ar for writing and br for reading. -
The compiler will not complain if you reuse an object following a delete, perhaps you are trying to redeclare it thus:
CArchive* ar = new Carchive(&f, CArchive::store);
...
delete ar;
CArchive* ar = new Carchive(&f, CArchive::load);
...
whereas your second statement should be written as
ar = new Carchive(&f, CArchive::load);
You have already declared
ar
as a pointer to a
CArchive
object so you must not redeclare it.