How to create a dynamic array of an Abstract class?
- by outsyncof
Lets say I have an abstract class Cat that has a few concrete subclasses Wildcat, Housecat, etc.
I want my array to be able to store pointers to a type of cat without knowing which kind it really is.
When I try to dynamically allocate an array of Cat, it doesn't seem to be working. Please help?
Cat* catArray = new Cat[200];