Sudantha Sudantha - 11 days ago 7
C++ Question

How to create a dynamic array of integers

How to create a dynamic array of integers in C++ using the

new
keyword?

Answer
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.