My class is Creature which has subclass called Human
I have a vector of * creatures
vector<Creature > * creatures .....
It is filled with dozens of creature objects. However I want to make one of those creatures into a Human, how can I do this as the vector isn't of that type.
This doesn't work
vector->at(10) = new Human();
I have a vector of * creatures
vector<Creature > * creatures .....
It is filled with dozens of creature objects. However I want to make one of those creatures into a Human, how can I do this as the vector isn't of that type.
This doesn't work
vector->at(10) = new Human();
Comment