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


Please Help Members By Posting Answers For Below Questions

Explain the concept of dynamic allocation of memory?

697


What is a string example?

648


Differentiate between a pointer and a reference with respect to c++.

795


What is virtual function? Explain with an example

673


What is array give example?

674






Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

727


What are the vectors in c++?

670


Why c++ is so important?

695


What are shallow and deep copy?

715


What are the rules for naming an identifier?

666


What is recursion?

744


When do we run a shell in the unix system? How will you tell which shell you are running?

638


What is :: operator in c++?

684


How const int *ourpointer differs from int const *ourpointer?

693


What is the use of class in c++?

666