I am working on a small project that contains a vector of base class pointers and my question is, is there anyway to tell which derived class is being stored in the container.
for example... we have a base class named creature and two derived classes named, alien and monster.
in code we would have..
std::vector<creature*> creatureList;
creatureList.pushBack(alien);
creatureList.pushBack(monster);
the creatureList contains both aliens and monsters.
now i want to iterate through the creatureList and perform different functions based on whether the object is an alien or a monster.
Is there any way to do this?