Abstract class and Multiple Inheritance errors??

S

santosh

Hi All ,
I got it working.. The problem was simple replacement of virtual
keyword to different place.

Below code works fine..

class Interface
{
public:
virtual void funA() = 0;
virtual void funB() = 0;
virtual void funD() = 0;
Interface();
~Interface();
};

class A : virtual public Interface
{
public:
A();
~A();
void funA()
{
printf("A::funA");
}
};

class B : virtual public Interface
{
public:
B();
~B();
void funB()
{
printf("B::funB");
}
};

class D: public A , public B
{
public:
D();
~D();
void funD()
{
printf("D::funD");
}
};

int _tmain(int argc, _TCHAR* argv[])
{
D *d;
d = new D;

return 0;
}

Thanks
-Sanotsh
//AbstractInterface
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top