Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
class Base
4.
{
5.
public:
6.
virtual void print() const = 0;
7.
};
8.
class DerivedOne : public Base
9.
{
10.
public:
11.
void print() const
12.
{
13.
cout
Options:
A .  DerivedOne
B .  DerivedTwo
C .  Error
D .  None of the mentioned
Answer: Option C

In this program, 'Base' is an ambiguous base of 'Multiple'. So it is producing an error. And this 

program is a virtual base class.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers