How to create a dynamic array of integers in C++ using the new
keyword?
int main()
{
int size;
std::cin >> size;
int *array = new int[size];
delete [] array;
return 0;
}
Don't forget to delete
every array you allocate with new
.