Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i want to use CArchive for storing data structures into buffers and loading them from it. no file is involved.
is it possible?
i think i should derive a class from CArchive and override << and >> operators.
Posted

You better NOT use CArchive, but write data in a file. If you use the standard file API of C likefopen you get portable code.

If you write a struct you use write and you are done.

plz dont use CArchive ;-)
 
Share this answer
 
If you are only keeping data in memory then why do you need something as complicated as a CArchive? Use one of the STL container classes[^].
 
Share this answer
 
I guess you may use a CMemFile[^] pointer in the CArchive constructor.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900