Vidyalelo
C++ Programming · Q57

Inheritance in C++

Programming · C++ Programming · question 57

Q57

What will be the output of the following C++ code? #include 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
Answer
B.
Error
C.
Runtime error
D.
None of the above

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board