📜  如何删除指针 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:34.444000             🧑  作者: Mango

代码示例1
// deleting pointer allocating an int
int *pointer1 = new int;
delete pointer1;

// deleting pointer allocating an array of ints
int *pointer2 = new int[10];
delete[] pointer2;