I'm having an issue that I don't understand. as I understand the C++ standard, my code should work the way I have it.
gcc 4.2.1 on opensuse 10.3 i386 complains saying that A::i is private in the context of the drived class. I don't get it. I thought protected members were accessible to derived classes. what am I doing wrong here?Code:class A { protected: int i; }; class B : public A { public: int foo() { return i; } };