观察程序(因为学堂在线系统限制,为了能够显示程序,程序中符号使用全角字符,实际应该使用半角,请在考虑答案时忽略全角字符的问题)#include<iostream> usingnamespacestd; intmain() { int*first,*second; first=newint(5); second=first; delete()second; delete()first; return0;} 该程序是否正确,原因是什么?
second和first指向相同的内容,本程序会造成多次删除,产生错误