I have a question. I am studying for an exam and am not clear on something. I have the following class definition.
class A
{
private:
int x;
protected:
int y;
public:
int z;
void f(int k);
};
class B : public A
{
private:
int w;
int f();
};
class C : private A
{
public:
int w;
void f(int K);
};
clas D : public B
{
public:
void f();
};
//These definitions are in the main()
A a;
B b;
C c;
//Which of the following are illegal?
cout<<b.f()<<"/n";
c.f(3);
b.z=5;
c.z=7;
I looked at all the statements and find that they are all legal?
Am I right?