[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 请教一个关于C++虚基类的问题



2010/4/24 何庆 <roolcz@gmail.com>:
> 请教一个关于C++虚基类的问题:
> class CBase{virtual fun1()...}
> class CDerive:pubilc CBase{fun1()....}
> 和下面的效果是不是一样:
> class CBase1{fun1()...}
> class CDerive1:virtual public CBase1{fun1()...}
>

第一个是虚函数,是实现多态
第二个虚基类是为了解决某个类多继承同一个基类的多个子类中产生多个数据成员副本的问题

>
> --
> To UNSUBSCRIBE, email to debian-chinese-gb-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: http://lists.debian.org/1272109434.2176.32.camel@debian.domain
>
>

Reply to: