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 does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal
What are pointer-to-members in C++? Give their syntax.
Define the process of handling in case of destructor failure?
What do you mean by C++ access specifiers ?
Write a corrected statement in c++ so that the statement will work properly. if (x = y) x = 2*z;
In a function declaration what does extern means?
What is object oriented programming (oop)?
How can you find the nodes with repetetive data in a linked list?
When to use “const” reference arguments in a function?
What are different types of typecasting supported by C++
What is an incomplete type?
Difference between delete and free.