-
What is the output of this program?
#include <iostream>
using namespace std;
struct Student1
{
int num;
};
struct Student2
{
int* val;
};
struct Student3 : public Student1, public Student2
{
};
int main()
{
Student3* ptr = new Student3;
ptr->val = 0;
cout << "Above structures are Inherited...";
return 0;
}
-
- Compilation Error
- Runtime Error
- Above structures are Inherited...
- Garbage value
- None of these
Correct Option: C
In this program, We apply the multiple inheritance to structure.