Question
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
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
Answer: Option A
Was this answer helpful ?
In this program, We apply the multiple inheritance to structure.
Output:
$ g++ mul2.cpp
$ a.out
Inherited
Was this answer helpful ?
More Questions on This Topic :
Question 6.
What is meant by multiple inheritance?
....
Submit Solution