Say I have
Class Base {}
Class Child: public Base {
void alert() { printf("alert"); }
}
How do I call alert() with type Base?
Base *p = new Child();
p->alert() // error, Base does not have alert method
I've tried this but doesn't work as well.
p->Child::alert() // error, Base does not have alert method
I can fix the problem if I move alert() to Base of course but I don't want Base to have alert() so it won't pass on to other children.
Class->classandPublic->public.