fly()
class bird { ... public: ... virtual void fly(); }; class pinguin : public bird { ... };
class pinguin : bird { new private void fly() { } }
bird theBird; pinguin thePinguin; covey theCovey; theCovey.add(theBird); theCovey.add(thePinguin); bird* pBird = theCovey.GetFirstBird(); while (pBird) { pBird->fly(); // now is here a pinguin, a bird as well... :) pBird = theCovey.GetNextBird(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)