Hi,
If a class Derived is inherited privately from a class Base and the Derived class has a friend function f(), so what members can f() access from Derived class and Base class.
class Base {
public:
int a;
protected:
int b;
private:
int c;
};
class Derived: private Base {
void friend f() {}
public:
int d;
protected:
int e;
private:
int f;
};
I understand that if a class is inherited privately from the base class, everything is private in the derived class.
But why in the code above, the function f() can access a, b, d, e, f but not c?