1.

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;
}

A. Compilation Error
B. Runtime Error
C. Above structures are Inherited...
D. Garbage value
E. None of these
Answer» D. Garbage value


Discussion

No Comment Found

Related MCQs