class abc{
protected:
int x;
};
class b: public abc{
public :
void something(abc a){ a.x = 1;}
};
I get an error in the second last line stating that I cannot access member x of variable a.
Error: Protected Member "abc::x" is not accessible through a "abc" point or object.
Is there another way to modify the x-value of variable a?
You can do simply as follows in derived class
Demo: http://coliru.stacked-crooked.com/a/b0f6153abfe6b783