Saving a class to a binary file

M

mlamb1

I have some code that works it seems a bit of a hack. I want to know
if there is a more c++y way to do it.

Here's my code

class CMyClass{
public:
void Save(CFile fOut);
void Load(CFile fOut);

char *mPointerIDoNotWantTosave;
char *mAnotherPointerIDoNotWantTosave;

int mDataIWantToSave;
..
..
..
int mDataEnd;
}

CMyClass::Save(CFile fOut)
{
 
B

BobR

I have some code that works it seems a bit of a hack. I want to know
if there is a more c++y way to do it. Here's my code

class CMyClass{
public:
void Save(CFile fOut);
void Load(CFile fOut);
char *mPointerIDoNotWantTosave;
char *mAnotherPointerIDoNotWantTosave;
int mDataIWantToSave;
int mDataEnd;
}
; // you were missing a semicolon here
CMyClass::Save(CFile fOut)
{

} // you were missing a curly-brace here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top