FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
9E/11.7 MultipleInheritance_Platypus.cpp at main · learncppnow/9E · GitHub
learncppnow
/
9E
Public
Notifications
You must be signed in to change notification settings
Fork
32
Star
78
Code
Issues
0
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
9E
/
11.7 MultipleInheritance_Platypus.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (30 loc) · 599 Bytes
Breadcrumbs
9E
/
11.7 MultipleInheritance_Platypus.cpp
Copy path
File metadata and controls
37 lines (30 loc) · 599 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
include
<
iostream
>
using
namespace
std
;
class
Animal
{
public:
Animal
()
{
cout <<
"
Animal constructor
"
<< endl;
}
int
age;
};
class
Mammal
:
public
Animal
{};
class
Bird
:
public
Animal
{};
class
Reptile
:
public
Animal
{};
class
Platypus
:
public
Mammal
,
public
Bird
,
public
Reptile
{
public:
Platypus
()
{
cout <<
"
Platypus constructor
"
<< endl;
}
};
int
main
()
{
Platypus duckBilledP;
//
uncomment next line of code to see compile failure because
//
age is ambiguous: three instances of base Animal per Platypus
//
duckBilledP.age = 25;
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL