It is desirable to develop your programs incrementally. Code a little, test a little. If you do this with virtual functions, you get into trouble. Discuss the problem and the (very simple) solution.
What will be an ideal response?
If you fail to define functions that has the virtual keyword, even if there
are no derived classes, even if there is only one function with the virtual keyword,
in fact you don’t even have to call the function! you will get an error message at
compile time to the effect that there is an undefined reference in a virtual table for
the class. The fix is easy. For virtual void functions put an empty pair of braces
for the function body. For virtual value returning functions, use a return
something; inside braces. Then there will be no problem with the tables.
You might also like to view...
Which of the following data structures uses a sentinel?
a. binary heap b. hash table c. queue d. stack e. none of the above use sentinels
A popular design element is the drop cap, which consists of an enlarged initial letter in a body of text that drops down into the text body.
Answer the following statement true (T) or false (F)
A list of items with each item introduced by a symbol such as a small circle or check mark, and which is useful when the items in the list can be displayed in any order
a. bulleted list b. numbered list c. outline list
A ________ contains instructions defining how a Web server should process data submitted from a form
A) form B) process file C) data file D) script