coderz.py

Keep Coding Keep Cheering!

Virtual Destructors in C++

What is a Virtual Destructor? Deleting a derived class object with a non-virtual destructor using a pointer of the base class type results in undefined behavior. While deleting instances of the derived class using a base class pointer object, a virtual destructor is used to free up the memory space allocated by the derived class […]

October 28, 2022 | C++ | No comments

Advertisement