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 use of 'using' declaration in c++?
How do I run a program in notepad ++?
What are references in c++?
Can I learn c++ in a week?
What is the difference between a baller and a reference in C++?
What is main function in c++ with example?
What is vectorial capacity?
What are stacks?
How can you link a c program with a c function?
What is using namespace std in c++?
What is the use of bit fields in structure declaration?
What is #include iostream h in c++?
Define a constructor - what it is and how it might be called (2 methods)?
Do you know the use of vtable?
When is the copy constructor called?