0
How to delete an object of class?
5 Réponses
+ 1
What language? Usually, when it is not longer reachable, it will be discarded. That may happen immediately or on the next collector run in languages with garbage collector.
0
simple, don't create.
0
Do you mean an object in a class? You could set it to null. Depending on the language.
0
@1of3, I read, I can delete an object of way delete pointer. It's c++. But, I create object, create pointer on it, delete this pointer, called a function of object, and had result this function. I mean, object has not deleted. I deleted pointer repeatedly and got multiple destructor's "dtor".
0
@Tim Haerkens, yes, I mean it. It's c++. That is, could set what? Object? Maybe create pointer and set it?