C++ hetergeneous list as an array of pointers to a abstract class getting c2259
Posted on 2014-04-05
I have an abstract class. I need to create a dynamic array of pointers to the class (or at least its derived classes). The abstract class is person
I am doing the following but getting c2259 cannon instantiate abstract class.
I know I cannot instantiate the class but can use with pointers. How can I create the array of pointers dynamically without using the base class Person?
Person* filelist = new Person[size];