how to force derived class to implement virtual functions of another class

class A
{
Public:
virtual void A1() = 0;
virtual void A2() = 0;
}

class B
{
public:
virtual void B1() = 0;
virtual void B2() = 0;
}

class C::public B
{
void B1();
void B2();
}

In the above example, i want class C to implement all the methods of class A. How do i do that? But this should come via B. If class B has a pointer of class A as a member, will it help me to achieve this? basically as of now i have A1 and A2 inside class B so it forces Class C to implement them. But i want to keep it as a seprate class so i want to know is there a way to achive this with A1 and A2 in different class.
1
2
3
4
5
6
7
8
9

class C : public B, public A
{
void B1() {};
void B2() {};
void A1() {};
void A2() {};
};
Hey Scarletpimp,

If you haven't done so already, you may find it helpful to work through this site's tutorial on classes (http://www.cplusplus.com/doc/tutorial/classes/) and class friend functions and inheritance (http://www.cplusplus.com/doc/tutorial/inheritance/).

~ Jack
Thanks for the help
Topic archived. No new replies allowed.