Thanh Thảo
New member
Which among the following is true for the given code below?
A. Object b can’t access disp() function
B. Object b can access disp() function inside its body
C. Object b can’t access members of class A
D. Program runs fine
Code:
class A
{
protected : int marks;
public :
A()
{
marks=100;
}
disp()
{
cout<<”marks=”<<marks;
}
};
class B: protected A
{
};
B b;
b.disp();
B. Object b can access disp() function inside its body
C. Object b can’t access members of class A
D. Program runs fine