when destructor is called? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

when destructor is called?

2nd Apr 2017, 5:46 AM
Võ Minh Triều
Võ Minh Triều - avatar
2 ответов
+ 2
"If the object was created as an automatic variable, its destructor is automatically called when it goes out of scope. If the object was created with a new expression, then itsdestructor is called when the delete operator is applied to a pointer to the object."
2nd Apr 2017, 5:58 AM
Eranga
Eranga - avatar