+ 4
Destructure
destructure can call only one time but what we have to delete multiple objects at different time ( first u delete some objects and now u have to delete some more objects)?
3 Réponses
+ 3
Generally speaking, you won't need to call the destructor explicitly –memory is freed when the object is no longer used. If you do need to manually free memory, take a look at "delete" keyword.
+ 2
first of all, it's destructor not destructure..(not trying to be a jerk, but that just changes the whole meaning)
second, each object is a seperate instance of the class, therefore each object has a seperate instance of the destructor declared in the class which gets called when that object is destroyed, not any other object.
+ 2
default destructor delete objects so no need for programmers destructor