I have following code:
//base
class base
{
public :
virtual void func(){
cout<<"Base::func"<< endl;
}
};
class derived : public base
{
public :
static void func() // overridden function
{
cout<<"derived::func"<< endl;
}
};
Here, I have overridden the func() in derived class as static. Why compiler won't allow this?