Search code examples
c++new-operatordynamic-allocation

How do I allocate memory by using new in C++?


I have following static declaration of memory:

void* array[5000];

How I can allocate the same memory using operator new in C++?


Solution

  • void **array = new void*[5000];