📜  cpp 中的悬空指针 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:51.987000             🧑  作者: Mango

代码示例1
int *p = new int; // request memory
*p = 5; // store value

delete p; // free up the memory
// now p is a dangling pointer

p = new int; // reuse for a new address