// Double the size of an array
#include <iostream>
void display( int *anArray, int aSize)
{
for(int i = 0; i < aSize; i++)
std::cout << i << '\t' << anArray[i] << '\n';
}
int main()
{
int size = 0;
int new_size = 0;
// CREATE AND POPULATE AN ARRAY
std::cout << "Please enter size of array: ";
std::cin >> size;
int *array = newint[size]{0};
for(int i = 0; i < size; i++)
array[i] = i * i + 1;
new_size = size * 2;
// CREATE LARGER ARRAY
int *resize_array = newint[new_size]{0};
std::copy(&array[0], &array[size], resize_array);
delete [] array;
display(resize_array, new_size);
return 0;
}