// @topic T52005 11/27/2012 -- Inheritance and Polymorphism // @brief Creates array of Shapes, calls draw() of each #include <iostream> #include "shape.h" #include "circle.h" #include "rectangle.h" int main() { Shape* shapes[] = { new Rectangle( 10, 20 ), new Rectangle( 45, 25 ), new Circle( 50 ), }; for ( int idx = 0; idx < sizeof( shapes ) / sizeof (Shape*); ++idx ) { shapes[ idx ]->draw(); }//for return 0; }