A dynamic array's start location is stored in a pointer.
If the array contains pointers, then it will be a double-pointer (which is just a pointer whose "pointee's" type also happens to be a pointer).
So you need a int** for the array pointer and int*[size] for the type of the allocated elements.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
usingnamespace std;
int main() {
int size;
cout << "Enter size of array: ";
cin >> size;
int** a = newint*[size];
for (int i = 0; i < size; i++)
a[i] = nullptr;
delete[] a;
}