Why we use distructor??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why we use distructor???

29th Aug 2017, 3:33 PM
Saad Ahmed
Saad Ahmed - avatar
2 Answers
+ 10
In order to explicitly specify program instructions when an object is uninitialised.
29th Aug 2017, 3:49 PM
Hatsy Rei
Hatsy Rei - avatar
+ 2
a destructor is important for freeing up the memory that was used by the object.
29th Aug 2017, 3:50 PM
Christian
Christian - avatar