I have the following classes:
class Base {
protected:
int myint;
};
class Derived : public Base {
public:
bool operator==(Base &obj) {
if(myint == obj.myint)
return true;
else
return false;
}
};
But when I compile it, it gives the following errors:
int Base::myint
is protected within this context
I thought that protected variables are accessible from the derived class under a public inheritance. What is causing this error?