📜  删除单个变量动态内存分配 - 无论代码示例

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

代码示例1
// assume ptr has previously been allocated with operator new
delete ptr; // return the memory pointed to by ptr to the operating system
ptr = nullptr; // set ptr to be a null pointer