class shape {};
class circle: public shape {};
class square: public shape {};
class doc {
shape* ar[3];
doc() {
createShape();
}
shape* appendShape();
};
doc d;
I need to save this object d into hard disk as binary format or send this data over network so that other program can populate this object.
I guess you are looking for object serialization. You might want to take a look at the Boost Serialization library. It can be used to save your objects to a file or a binary stream that could be sent over the network. It also can serialize your objects into an XML representation.