I wrote this and wondering why "deleted" isn't showing as output.
int *p=NULL;
p=new int(10);
cout<<*p<<endl;
delete p;
if(p==NULL)cout<<"deleted"<<endl;
Can Someone explain why it isn't printing after using delete and why delete isn't making the pointer NULL ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…