#include #include #include #include #include using namespace std; class Animal { public: virtual void do_act(); }; void Animal::do_act() { cout <<"Move Move!"< animals; Dog fido; Cat fritz; Animal snail; cout << "The dog "<do_act(); // Since we used the pointer, we still have the Cat behavior cout <<"The cat assigned to an Animal"<do_act(); // Since we didnt copy, we can still call the Cat do_act cout <<"The cat in a vector of Animals"< pets; pets.push_back(fido); pets.push_back(fritz); pets[1].do_act(); // This will call the Animal do_act system("pause"); }