虚拟继承的定义方式

    技术2022-06-28  50

    #include <iostream> using namespace std; class A { public: void vf() {cout<<"I come from class A"<<endl;} }; class B:virtual public A {}; class C:virtual public A {}; class D:public B,public C {}; void main() { D d; d.vf(); }


    最新回复(0)