Suppose each of the base class and the derived class has a member function with the same signature. Suppose you have a base class pointer to a derived class object and call the common function member through the pointer. Discuss what determines which function is actually called, whether the one from the base class or the one from the derived class. Consider both the situations where the base class function is declared virtual and where it is not.
What will be an ideal response?
The non-virtual case: If the base class function does not carry the virtual modifier, then the function called follows the pointer type, which is the base class function.
The virtual case: If the base class function carries the virtual modifier, then the function called follows the object type, which is the derived class function.
You might also like to view...
Windows 10 is a desktop operating system and is able to function as either a member server or a domain controller.
Answer the following statement true (T) or false (F)
What is the main difference between a team site and a public site?
What will be an ideal response?
Windows 10 supports _____ categories of additional user accounts.
A. ?two B. three C. four D. ?five
Learning systems allow a computer to change how it reacts to situations based on the feedback it receives.
Answer the following statement true (T) or false (F)