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 / guest
Ans is value 1 i.e ans B
Is This Answer Correct ? | 22 Yes | 0 No |
Post New Answer View All Answers
Explain the concept of dynamic allocation of memory?
What is a string example?
Differentiate between a pointer and a reference with respect to c++.
What is virtual function? Explain with an example
What is array give example?
Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).
What are the vectors in c++?
Why c++ is so important?
What are shallow and deep copy?
What are the rules for naming an identifier?
What is recursion?
When do we run a shell in the unix system? How will you tell which shell you are running?
What is :: operator in c++?
How const int *ourpointer differs from int const *ourpointer?
What is the use of class in c++?