To answer your specific question: You are not printing anything.
Add this to your code
for (vector<Car*>::const_iterator iter = cars.begin(); iter != cars.end(); ++iter)
(*iter)->print();
solved Implement a class Person with two fields name and age, and a class Car with three fields [closed]