mardi 2 mars 2021

Static member function and run time polymorphism [closed]

class Base
{
    static Base *b;
    public:
    static Base* get();
};

Base* Base::b=null;

Base* Base::get(){Base* b = new Derived();return b;}

I get a compile time error in call Base::get(). Why?

Aucun commentaire:

Enregistrer un commentaire