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 the last index number in an array of 100 characters a) 100 b) 99 c) 101
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.
What is the use of function pointer?
What's c++ used for?
What are static type checking?
What is namespace std; and what is consists of?
What is the hardest coding language to learn?
What are the important differences between c++ and java?
int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}
What is a static element?
Do class declarations end with a semicolon?
What is the outcome of cout< a) 16 b) 17 c) 16.5
What is algorithm in c++ programming?
Can we distribute function templates and class templates in object libraries?
What is a wchar_t in c++?