I was expecting the delete command to screw up the output, but it doesn't. What is it about delete that I'm not understanding?Code:#include<iostream.h> #include<cmath> int main() { int elements; cin>>elements; unsigned long *dynar = new unsigned long[elements]; for ( int x = 1; x <= elements; ++x ) dynar[x-1] = (unsigned long)pow(x,2); delete []dynar; for ( int x = 1; x <= elements; ++x ) cout<<"Element "<<x-1<<" is "<<dynar[x-1]<<"\n"; return 0; }
(using Bloodshed Dev-C++ 4.9.8.0)