Here are 2 classes
class B
{
private:
int x;
public:
friend std::istream& operator>>(std::istream& in, B& obj)
{
in >> obj.x;
return in;
}
};
class D: public B
{
private:
int y;
public:
friend std::istream& operator>>(std::istream& in, D& obj)
{
//?
}
};
Is there any way that I can overload the >> operator in class D so it will be able to access the element x in B?
xprotected ;)