class professor {};
class teacher : public virtual professor {};
class researcher : public virtual professor {};
class myprofessor : public teacher, public researcher {};
Referring to the sample code above, if an object of class
"myprofessor" were created, how many instances of professor
will it contain?
a) 0
b) 1
c) 2
d) 3
e) 4
Answer Posted / d.sakthi
ans is 1 option b
reason:as three classes are derived from base class single instance is enough
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is the difference between the parameter to a template and the parameter to a function?
what is a class? Explain with an example.
What are virtual functions in c++?
Write a program to add three numbers in C++ utilizing classes.
what are the types of Member Functions?
What is an adaptor class or wrapper class in c++?
What's c++ used for?
What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard
How to tokenize a string in c++?
What are special characters c++?
What do the header files usually contains?
Tell me can a pure virtual function have an implementation?
What is the need of a destructor?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?
What do you mean by overhead in c++?