We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa081f6 commit c5cba44Copy full SHA for c5cba44
Multi_level_Inheritance.cpp
@@ -0,0 +1,29 @@
1
+#include <iostream>
2
+using namespace std;
3
+ class Animal {
4
+ public:
5
+ void eat() {
6
+ cout<<"Eating..."<<endl;
7
+ }
8
+ };
9
+ class Dog: public Animal
10
+ {
11
12
+ void bark(){
13
+ cout<<"Barking..."<<endl;
14
15
16
+ class BabyDog: public Dog
17
18
19
+ void weep() {
20
+ cout<<"Weeping...";
21
22
23
+int main(void) {
24
+ BabyDog d1;
25
+ d1.eat();
26
+ d1.bark();
27
+ d1.weep();
28
+ return 0;
29
+}
0 commit comments