forked from Backslash-Computing-Society/Hacktober
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path5_3.cpp
More file actions
41 lines (39 loc) · 626 Bytes
/
5_3.cpp
File metadata and controls
41 lines (39 loc) · 626 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include<iostream>
using namespace std;
class base{
int b;
public:
base(){cout<<"\nbase constructor\n";
}
~base(){cout<<"\nbase destrcutor\n";
}
};
class der1 : virtual public base{
int d1;
public:
der1(){cout<<"\nder1 constructor\n";
}
~der1(){cout<<"\nder1 destructor\n";
}
};
class der2 : virtual public base{
int d2;
public:
der2(){cout<<"\nder2 constructor\n";
}
~der2(){cout<<"\nder2 destructor\n";
}
};
class comb : public der1,public der2{
int c;
public:
comb(){cout<<"\ncomb constructor\n";
}
~comb(){cout<<"\ncomb destructor\n";
}
};
int main()
{
comb ob;
return 0;
}