Suppose I have class A
with a virtual function F()
:
class A
{
virtual void F()
{
// Do something
};
};
And I have another class B
which inherits A
and redefines F()
:
class B : A
{
void F()
{
// Do something
};
};
And a different class C
which also inherits A
but overrides F()
:
class C : A
{
void F() override
{
// Do something
};
};
What is the difference between F()
in classes B
and C
?