E
Eagle
Hi,
I'm sure I learnt this at college but have now forgotten ......
I need to save the following to file:
class Company {
private:
char name[50];
// etc..
Contact* con;
public:
// various accessors and modifiers etc
}
The contact class is a simple name and phone no. stuff.
I can read the Company class (without the Contact pointer) to file
(ios::binary) and read them all back into a linked list. But if I include
the Contact stuff, it is all screwed - prob because I'm storing the pointer
.......
So how does one save to file objects that contain other objects (either via
association or containment ...)?
Thanks
I'm sure I learnt this at college but have now forgotten ......
I need to save the following to file:
class Company {
private:
char name[50];
// etc..
Contact* con;
public:
// various accessors and modifiers etc
}
The contact class is a simple name and phone no. stuff.
I can read the Company class (without the Contact pointer) to file
(ios::binary) and read them all back into a linked list. But if I include
the Contact stuff, it is all screwed - prob because I'm storing the pointer
.......
So how does one save to file objects that contain other objects (either via
association or containment ...)?
Thanks