The title is probably confusing.
Suppose we have the following set up;
class A
{
public:
virtual void fn() = 0;
};
class B
{
public:
virtual int fn() {};
};
class C: public A, public B
{
};
Is there any way to define A::fn in class C?
No. This is not possible. It will always conflict with either of the
fn().The syntax of
fn()are different,and in
Bis,You have to make those syntax same in
AandBto letCimplement thefn(). Demo.