How do I allocate memory by using new in C++?
-
10-02-2021 - |
Domanda
I have following static declaration of memory:
void* array[5000];
How I can allocate the same memory using operator new
in C++?
Soluzione
void **array = new void*[5000];
Altri suggerimenti
at above there is array of pointers here is just an array of Integer.
int array = new int [5000];
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow