От: | Аноним | ||
Дата: | 01.11.09 19:20 | ||
Оценка: |
class base
{
private:
base* parent;
public:
base* get_parent() { return parent; }
protected:
void test_protected() {};
};
class derived_A : public base
{
public:
void test() {
test_protected(); //OK
get_parent()->test_protected(); error C2248: 'base::test_protected' : cannot access protected member declared in class 'base'
}
};
int _tmain(int argc, _TCHAR* argv[])
{
derived_A a;
a.test();
return 0;
}