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

Pure Virtual Functions and Abstract Classes

What are Pure Virtual Functions? A pure virtual function is a virtual function in C++ that does not require any function definition and is only declared. It is declared by assigning a value of 0 to the declaration. For instance, What is an Abstract Class? In C++, an abstract class has at least one pure […]

October 27, 2022 | C++ | No comments

Advertisement