Category: virtual function
When to use virtual functions in C++?
When we want a Derived Class to override a member function of Base class, then we should make that member function in Base class virtual. So that if someone uses the Derived class object using Base class’s pointer or reference to call the overridden member function, then function of derived class should be called. Suppose draw() is …
How virtual functions works internally using vTable and vPointer?
In this article we will discuss that how virtual functions in C++ works internally using vTable and vPointer. If you are not clear on what is virtual function and in which scenarios we need them, then we suggest you to go through this article first, Advertisements https://ownyourlife.com.ng//when-should-i-use-virtual-functions-in-c/ virtual functions is based on run time binding. So, let’s …
How virtual functions works internally using vTable and vPointer?Read More