This is a problem based on C++11.
What‘s happened when I delete a dynamic array by another pointer? Has this dynamic array been deleted actually?
int* a = new int[NUM01];
int* a1 = a;
for (int i = 0; i < NUM01; i++) {
a1[i] = 0;
}
delete[] a1; //What's happened?
I try to observe a[0].
cout << a[0] << endl;
delete[] a1;
cout << a[0] << endl;
The result is: 0 -572662307
What's the real?