#include<iostream.h>
#include<conio.h>
class A
{
public:
A()
{
cout<<"C-A"<<endl;
}
};
class B
{
public:
B()
{
cout<<"C-B"<<endl;
}
};
class C: A, virtual B
{
public:
C()
{
cout<<"C-C"<<endl;
}
};
int main()
{
clrscr();
C ob;
getch();
return 0;
}
Output:
C-B
C-A
C-C
No comments:
Post a Comment