0
votes

Suppose there is a derived class with a redefined function called print. Now I am accessing the derived class object using a base class pointer p.

Example 1.print() is a virtual function.

p->print() is called.This prints the derived class functionality at dynamic binding.

Example 2. print() is not a virtual function

p->print() is called. This prints the base class functionality. But my question is whether this is static binding or still dynamic binding?

1

1 Answers

4
votes

It would generally be considered static binding because which function is called is known and fully determined at compile time.