Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
struct a
4.
{
5.
int count;
6.
};
7.
struct b
8.
{
9.
int* value;
10.
};
11.
struct c : public a, public b
12.
{
13.
};
14.
int main()
15.
{
16.
c* p = new c;
17.
p->value = 0;
18.
cout
Options:
A .  Inherited
B .  Error
C .  Runtime error
D .  None of the mentioned
Answer: Option A

In this program, We apply the multiple inheritance to structure.
Output:
$ g++ mul2.cpp
$ a.out
Inherited



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers