C++ examples for Class:Inheritance
Investigates diamond-shaped multiple inheritance
#include <iostream> using namespace std; class A//w ww . j a v a 2 s. c o m { public: virtual void func(){} }; class B : public A { }; class C : public A { }; class D : public B, public C { }; int main() { D objD; //objD.func(); //ambiguous: won't compile return 0; }