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
How to tokenize a string in c++?
why is iostream::eof inside a loop condition considered wrong?
Write a program in C++ for Fibonacci series
int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}
Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?
Differentiate between realloc() and free().
Write bites in Turbo c++ Header ("Include") Files.
Do you need a main function in c++?
What are the 3 levels of programming languages?
What is c++ redistributable?
List different attributes in C++?
Explain binary search.
Why is main an int?
Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work
Explain one-definition rule (odr).