Listing 3
class A { int i; public: A():i(0) {}; ~A() {}; virtual int get_val() {return i;}; }; class B { int j; public: B():j(45) {}; ~B() {}; virtual int get_val() { return j;}; }; class C: public A, public B { int k; public: C():k(76) {}; ~C() {}; virtual int get_val() { return k; }; } int foo(void) { C c, *pc; pc = &c; return pc->get_val(); }