Tema: c++ protected metodas
Autorius: blah
Data: 2009-05-08 14:48:07
bandand sukompiliuot toki dalyka su g++:
-----------------------------

class A {
    protected:
        void foo();
};

class B : public A { };

int main()
{
    B *b = new B();
    b->foo();

    return 1;
}
-----------------------------
ismeta klaida:

test.cpp: In function 'int main()':
test.cpp:3: error: 'void A::foo()' is protected
test.cpp:13: error: within this context

ka blogai darau?

dekoju