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
Answers were Sorted based on User's Feedback
Answer / ahsanullah
becouse of virtual keyword it will create only one instances,
so ANS is: 1
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / 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 |
What is an Object/Instance?
What is general format for a prototype?
Is linux written in c or c++?
What is dynamic and static typing?
Can you sort a set c++?
how to explain our contribution in the project?
What are the various compound assignment operators in c++?
What are static type checking?
Why do we need function?
What is an iterator?
Is c++ faster than c?
How the keyword struct is different from the keyword class in c++?