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 / ahsanullah
becouse of virtual keyword it will create only one instances,
so ANS is: 1
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is decltype c++?
Is it possible to have a recursive inline function in c++?
why is c++ called oops? Explain
explain the reference variable in c++?
What are advantages of c++?
Explain overriding.
What is a character in c++?
What is ofstream c++?
What is #include ctype h in c++?
Explain deep copy and a shallow copy?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
What is flush c++?
What is the use of default constructor?
What is the difference between global variables and local variable
What is atoi?