Consider the following What is the output of this program Th

Consider the following: What is the output of this program? This is base\'s vfunc() This is derived1\'s vfunc(). This is derived1\'s vfunc(). This is derived1\'s vfunc() Error Ambiguous reference This is base\'s vfunc(). This is base\'s vfunc(). Click Saw and Submit to save and submit. Click Save All Answer to save all answer.

Solution

Since virtual function is not used run time binding will not happen instead static binding will happen in which based on the type of pointer function will be called since in both the cases type of pointer is base base class vfunc() will be called hence the answer is

this is base\'s vfunc()

this is base\'s vfunc()

 Consider the following: What is the output of this program? This is base\'s vfunc() This is derived1\'s vfunc(). This is derived1\'s vfunc(). This is derived1\

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site