📅  最后修改于: 2022-03-11 14:57:45.987000             🧑  作者: Mango
int x= 1000; //creates a new
memory block
int* p = x; // *p is the pointer to address block 1000(mem location)
int *p = 20;
printf("%d",*p); //This pointer prints 20
delete p;
printf("%d",*p); // This would throw an error, because now p is
// inaccessible or dangling. *p is a dangling pointer.