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
Can I learn c++ as my first language?
Can a function take variable length arguments, if yes, how?
Is c++ pass by reference or value?
You want to link a c++ program to c functions. How would you do it?
What is virtual function? Explain with an example
How to access a variable of the structure?
Can c++ be faster than c?
What operator is used to access a struct through a pointer a) >> b) -> c) *
What are the uses of pointers?
What is setiosflags c++?
What do you mean by late binding?
How can you quickly find the number of elements stored in a dynamic array?
What is the use of vtable?
What type of question are asked in GE code writing test based on c++ data structures and pointers?
What is ios :: in in c++?