/* * @topic T10340 Feb 5, 2013 Inheritance C++ Demo * @brief Main application class, InheritanceMain */ #include <iostream> #include "vwcharacter.h" #include "cat.h" #include "dog.h" int main() { VWCharacter* characters[ 10 ]; int idx = 0; // create cats for ( ; idx < 6; ++idx ) { characters[ idx ] = new Cat(); } // create dogs idx = 6; for ( ; idx < 10; ++idx ) { characters[ idx ] = new Dog(); } // animate the world idx = 0; for ( ; idx < 10; ++idx ) { characters[ idx ]->speak(); } }