cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
is-a has-a relationship
is-a has-a relationship
Dec 23, 2011 at 11:26pm UTC
kinley
(63)
Hello,
Could someone please explain how the is-a and has-a relationships can be implemented in C++. Couldnt find any helpful URL on Google.
Thank you.
Dec 23, 2011 at 11:32pm UTC
Athar
(4466)
Inheritance, composition.
Couldnt find any helpful URL on Google.
Really?
http://www.google.de/search?hl=en&q=c%2B%2B+is-a+relationship
Last edited on
Dec 23, 2011 at 11:36pm UTC
Dec 24, 2011 at 12:06am UTC
Galik
(2254)
Here Dog
is a
Animal and
has a
name:
1
2
3
4
5
6
7
8
9
10
class
Animal { };
class
Dog :
public
Animal { std::string name; };
Dec 24, 2011 at 6:48am UTC
IceThatJaw
(529)
Inheritance = is-a
Topic archived. No new replies allowed.