In this little program I enter 10 integers and display them back
using arithmetical operation to a pointer.
it compiles, accepts my input, display the elements, but right after
that it causes an error. if I delete the "delete [] numbers" I will
be OK and if I use the pointer notation syntax "*(numbers + i)"
it works fine. here's the code...
can anyone explain me why?


TIA
#include <iostream>
using namespace std;
int main ()
{
const int max_value = 10;
int* numbers = new int[max_value];
int cnt = 0;
do
{
cout << "\nPlease, enter integer #" << cnt + 1 << ": ";
cin >> *(numbers + cnt);
cnt++;
}while (cnt < 10);
for (int i = 0; i < max_value; i++, numbers++)
cout << endl << *numbers << endl;
delete [] numbers;
cout << endl;
return 0;
}