I'm working on a program to practice dynamic arrays. What I'm trying to do is have the user input numbers to fill an array that will double in size when it gets full. When the current array is full, the filled array should be copied to a temporary array, then deleted. A new array with double the size of the previous is then created, and then the values of the temporary array should be copied to the newly created array. The temporary array is then deleted, and the process should be repeated until the user inputs -1. When the user inputs -1, the program should display all the the numbers recorded in the array.
I keep getting an error I believe because of this part of the code.