How virtual destructor works internally C++?

In simple terms, a virtual destructor ensures that when derived subclasses go out of scope or are deleted the order of destruction of each class in a hierarchy is carried out correctly . If the destruction order of the class objects is incorrect, in can lead to what is known as a memory leak.

Sizin İçin Seçtik  When 5G will launch in UAE?

Leave a Reply

Your email address will not be published. Required fields are marked *