I haven\'t done C++ in a while and can\'t figure out why following doesn\'t work:
class A { protected: int num; }; class B : public A { }; main () { B
"Protected" means protected from access outside of a member function, or a member function of a derived class. The "main" function isn't a member of either class, but it's trying to directly access the member variable.