#include #include #include using namespace std; class CNode{ public: CNode(int val){ pi_val=new int(val); } CNode(CNode &other){ pi_val=other.pi_val; for(int i=0; ivPrint(); } } private: int *pi_val; vector v_kids; }; class CTree{ public: CTree(){ pc_root=new CNode(0); } CTree(CTree &other){ ??? } ~CTree(){ delete pc_root; } CNode *pcGetRt(){ return pc_root; } void vPrint(){ pc_root->vPrint(); } private: CNode *pc_root; }; int main() { CTree c_t0; c_t0.pcGetRt()->vSetVal(1); c_t0.pcGetRt()->vAdd(new CNode(2)); CNode *pc_buf; pc_buf = new CNode(3); pc_buf->vAdd(new CNode(4)); c_t0.pcGetRt()->vAdd(pc_buf); CTree *pc_copy = new CTree(c_t0); c_t0.vPrint(); //pc_copy->vPrint(); delete pc_copy; }