What happens when 2 abstract class have the same signature function to be overriden? [closed]

  c++, c++14, c++17, oop

I am facing weird inheritance hierarchy error which I root caused to this code snippet

class A{
public:
   virtual void f(int a) = 0;
   virtual void d() =0;
};

class B{
public:
   virtual void j(string x) = 0;
   virtual void d() =0;
};

class C : public A,
          public B{
    
    void f(int a) override{

    }

    void j(string x) override{

    }

    void d() override{

    }

}

I have overriden function d just once as it’s the same signature in both parent class, but this causes weird inheritance error which I couldn’t understand.However when I comment public B inheritance all looks good. Do you might know what’s wrong here? How should I go about this ?

Source: Windows Questions C++

LEAVE A COMMENT