How to dynamically allocate an array of pointers in C++?

Node::Node(int maxsize,int k)
{
   NPtr = new Node*[maxsize];
}

But as usual, you are probably better off using a std::vector of pointers.

Leave a Comment