#include using namespace std; int main() { int *p = new int; // allocate memory pointed by p *p = 3; cout << "address:" << p << " content:" << *p << endl; delete p; // delete it, memory area returned to the heap, // but p still points to it. *p = 20; // however you can still manipulate the deleted memory area cout << "address:" << p << " content:" << *p << endl; // and this statement may display 20 // but after deletion the pointer p is an address in available heap, // so it should not be used p = NULL; // however, if you make it NULL (zero) delete p; *p = 6; cout << *p << endl; // then you cannot access. That gives a run-time error. return 0; }