class foo{
protected:
int value;
};
class bar: public foo{
public:
void zzz(foo &a){
a.value = 42;
}
};
foo.cpp:9:5: error: 'value' is a protected member of 'foo'
a.value = 42;
^
foo.cpp:3:6: note: can only access this member on an object of type 'bar'
int value;
^
1 error generated.
It would work if the function was void zzz(bar&);
I don't know the rationale behind this decision.
PS: when posting code, use code tags [code][/code]