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 / d.sakthi

ans is 1 option b
reason:as three classes are derived from base class single instance is enough

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is const pointer and const reference?

590


What is the benefit of learning c++?

545


What is data type in c++?

553


Is string an object in c++?

652


What is a map in c++?

579






What is the use of 'this' pointer?

765


Can c++ do everything c can?

596


Explain virtual destructor?

671


Is overriding possible in c++?

567


What is the use of function pointer?

573


What are the unique features of C++.

567


What kind of jobs can I get with c++?

591


Can you Mention some Application of C/C++?

621


What is a loop? What are different types of loops in c++?

591


Define a nested class. Explain how it can be useful.

632