What is late happening in late binding
Hi Assume that we have inheritance in class and it does not have virtual involved. So, this falls in early binding. In other words, object.functioncall will link function definition to base or derived class at compile time and function call is linked to set of instructions (due to function definition) at compile time only. No run time overhead. Runner just execute instructions linked at compile time. Correct? Now in case of virtual , it is late binding. But what is late? B class has virtual method so b, d1 and d2 all three class have vtable at compile time. At compile time only, we have pb = new d1 ; means pb knows at compile time that it has vptr of d1 class. Just link d1 method here at compile time. What is big deal here and why compiler doe not link Amy functions at compiler time? https://sololearn.com/compiler-playground/c9DNr7S8FSbc/?ref=app Question 2: virtual base class also include overhead when non virtual function is called ?