By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

Saving a class to a binary file

P: n/a
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)
{

Jun 15 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a

<ml****@gmail.comwrote in message ...
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.

--
Bob R
POVrookie
Jun 15 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.