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...
List three of the six common work functions specified in the EBK for the management process for risk management.
What will be an ideal response?
Which of the following ways to format text into columns fills the left column entirely with text and then continues the text into the next column?
A. edit column B. tabs C. tables D. columns
A Web ____________________ is a computer that uses special software to transmit Web pages over the Internet.
Fill in the blank(s) with the appropriate word(s).
Answer the following statements true (T) or false (F)
1. (x < 4) when x = 5 2. (x < 4) when x = 4 3. (x < 4) when x = 3 4. (x < 4) when x = —3 5. (x — 5) >= 2 when x = 10