#include <iostream>
#include <cstdio>
using namespace std;
int main(void)
{
int arr[] = {1,4,2,3,5,6};
int *p = arr;
delete p;
for(int i = 0 ; i < 6; i++)
cout << p[i];
return 0;
}
输出是142356
。当我说delete p
为什么不删除 p 时?
运行代码时不应该出现分段错误吗?