#include  <algorithm>
int main()
{
    // set up arr1
    int *arr1 = new int[5]; // make array of 5 ints and set arr1 to point to it

    // add data to arr1
    arr1[0] = 1;
    arr1[1] = 2;
    arr1[2] = 3;
    arr1[3] = 4;
    arr1[4] = 5;

    // set up arr2
    int *arr2 = new int[10]; // make array of 10 ints and set arr2 to point to it
    // arr2 = arr1; // lose the array of 10 ints forever and set arr2 to point to array of 5 ints
    std::copy(arr1, arr1+5, arr2); // copy the contents of the array of 5 ints into the array of 10 ints

    // add more values
    arr2[5] = 6;
    arr2[6] = 7;
    arr2[7] = 8;
    arr2[8] = 9;
    arr2[9] = 10;

    delete[] arr1;
    delete[] arr2;
}
