How do I make an array of pointers?
I'm trying to make an array of pointers to a class in order to provide both O(1) access and have O(1) insertion. This is essentially what I've got. It has to be an array of pointers hence datalist
being a pointer to a pointer. I think this is more of a lack of syntactical knowledge.
class Data{
};
class List{
private:
Data** datalist;
public:
explicit List(int s = 20):datalist{/* new something */}{}
};
Thanks.