I am royally confused with how this code processes. I know the output is 2 since I compiled it, but I am uncertain of how the code works. Sorry, I'm new to C++ and correct me if I am wrong but
*(numbers + i) = i; is the equivalent of i += numbers;
I just don't understand the new int array in the pointer location and how that fits into the loop.
1 2 3 4
int *numbers = newint[5];
for (int i = 0; i <= 4; i++)
*(numbers + i) = i;
cout << numbers[2] << endl;