1 2 3 4 5 6 7 8 9 10 11
int main() { int *ptr; int n = 20; ptr = new int[n]; ptr[5] = 7; ptr[6] = 9; cout << ptr[5] << " " << ptr[6] << "\n"; delete[] ptr; cout << ptr[5] << " " << ptr[6]; }
1 2
7 9 -1785358955 -1785358955