As already mentioned, you need functions virtualto enable polymorphic behavior and cannot store classes directly by value in vector.
std::vector<A>, , , , . push_back() A, , . .
, , ( ) , vector:
std::vector<A*> things;
things.push_back(new B());
things[0]->print();
for(std::vector<A*>::iterator it = things.begin(); it != things.end(); ++it)
delete *it;