类A与类B有以下几种关系:
继承关系
单一继承
多重继承
内嵌关系 http://www.cnblogs.com/kyleada/archive/2011/05/19/2051243.html
class Tree //树类
{
public:
class Branch //树叉类
{
void func();
};
};
class River //河类
{
public:
class Branch //河叉类
{
void func();
};
};
Tree tree;
tree.Branch.func();
River river;
river.Branch.func();
Tree::Branch.func();
River::Branch.func();
类的合成