struct A {
protected:
int y;
public:
int z;
};
struct F : A {
public:
using A::y;
private:
using A::z;
};
int main() {
F obj_F;
obj_F.y = 9;
obj_F.z = 10;
}
In the above code obj_F.z = 10; - is allowed. Explanation: The access of member z is still public. The private using declaration using A::z has no effect on the access of z.
Can someone tell me, if z, which is declared as private, is accessible outside, then what is the meaning of that private? What does it do?
Thanks
-Saiyasodharan