How would you create a function that would read a dynamic array that is created by the user, with values also being put in by the user?

```
int main() {

    int choice;
    int choice2;
    bool confirm = true;
    bool confirm2 = true;
    int *array1 = NULL;
    int *array2 = NULL;
    while(confirm==true){

        if (choice > 0)
        {
            array1 = new int[choice];
            confirm = false;
        }
        else if(choice <= 0)
        {
            cout<<"Try again, positive numbers only" << endl;
        }
    }
    //get size for 2nd array
    while (confirm2 == true){

        cout << "Input a number for array size for array 2: " << endl;
        cin >> choice2;

        if (choice2 > 0)
        {
            array2 = new int[choice2];
            confirm2 = false;
        }
        else if (choice2 <= 0)
        {
            cout << "Try again, positive numbers only" << endl;
        }
    }

    cout << "Enter numeric values into the array" << endl;

    for (int i = 0; i < choice; i++)
    {
        int item;
        cout << "Enter a numeric for item " << i << endl;
        cin >> item;
        *(array1 + i) = item;
    }
}

```

My problem in this one is that I don't know if its possible to create a function that would read and modify the array that has been created by the user.