int main(){ int * p = new int(10); cout << *p << endl; delete p; cout << *p << endl; int * arr = new int[10]; for(int i=0; i< 10 ; i++){ arr[i] = i +10; } for(int i=0; i< 10 ; i++){ cout << arr[i] << endl; } delete [] arr; cout << arr[0] << endl; return 0; }
标签:int,内存空间,内存,new,开辟,delete From: https://www.cnblogs.com/itniwota/p/16894465.html