delete this problem# Programming - 葵花宝典
a*e
1 楼
I have a class A, in the constructor, I say: if somevariable != 2,
delete this. basically, i hope that after calling delete this,
the pointer i make from "new A(int)" becomes NULL, but it turns out
that the pointer is still valid, only the member variable value is
reset to zero. Anybody knows what is going on? Wouldn't delete this
should call the destrcutor of the class?
delete this. basically, i hope that after calling delete this,
the pointer i make from "new A(int)" becomes NULL, but it turns out
that the pointer is still valid, only the member variable value is
reset to zero. Anybody knows what is going on? Wouldn't delete this
should call the destrcutor of the class?