adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    using namespace std;
    struct a
    {
        int count;
    };
    struct b
    {
        int* value;
    };
    struct c : public a, public b
    {
    };
    int main()
    {
        c* p = new c;
        p->value = 0;
        cout << "Inherited";
        return 0;
    }

a.

Inherited

b.

Error

c.

Runtime error

d.

None of the mentioned

Answer: (a).Inherited

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?