vector not vektor![]()
You don't need the STL to use virtual inheritance, which is what goes on here:Code:class Parent { public: virtual void Func() = 0; }; class ChildA : public Parent { public: void Func() { cout << "Die!" << endl; } }; class ChildB : public Parent { public: void Func() { cout << "Live!" << endl; } }; void somecode() { Parent *ptr; ChildA *thing = new ChildA; ChildB *other = new ChildB; ptr = thing; ptr->Func(); ptr = other; ptr->Func(); delete thing; delete other; }





Reply With Quote