0

How to delete an object of class?

10th Aug 2017, 8:17 PM
Alexik
Alexik - avatar
5 ответов
+ 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.
10th Aug 2017, 8:26 PM
1of3
1of3 - avatar
0
simple, don't create.
10th Aug 2017, 8:24 PM
meherDev
meherDev - avatar
0
Do you mean an object in a class? You could set it to null. Depending on the language.
10th Aug 2017, 9:20 PM
Tim Haerkens
Tim Haerkens - avatar
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".
10th Aug 2017, 9:21 PM
Alexik
Alexik - avatar
0
@Tim Haerkens, yes, I mean it. It's c++. That is, could set what? Object? Maybe create pointer and set it?
10th Aug 2017, 9:26 PM
Alexik
Alexik - avatar