#include using namespace std; int main(int argc, char *argv[]) { double *p1, *p2; int n = 10; p1 = new double[n]; // allocate array p2 = p1; // p2 points to array delete[] p1; // p2 now ``dangles'' p2[3] = 5.7; // Ooopppsss!!! p1 = new double[3]; for ( int i = 0; i < n; i++ ) cout << p2[i] << " "; cout << "\n"; p2[3] = 5.7; delete[] p1; cout << "Deleted p1\n"; delete[] p2; cout << "Deleted p2\n"; }