< previous page page_258 next page >

Page 258
LISTING 16.4 continued
d5ef64f4d3250b96ba5c07ca5bbc2f56.gif
71:   }
72:
73:   Dog::Dog():
74:   Mammal(),
75:   itsBreed(YORKIE)
76:   {
77:      cout << Dog constructor\n;
78:   }
79:
80:   Dog::Dog(int age):
81:   Mammal(age),
82:   itsBreed(YORKIE)
83:   {
84:      cout << Dog(int) constructor\n;
85:   }
86:
87:   Dog::Dog(int age, int weight):
88:   Mammal(age),
89:   itsBreed(YORKIE)
90:   {
91:      itsWeight = weight;
92:      cout << Dog(int, int) constructor\n;
93:   }
94:
95:   Dog::Dog(int age, int weight, BREED breed):
96:   Mammal(age),
97:   itsBreed(breed)
98:   {
99:      itsWeight = weight;
100:     cout << Dog(int, int, BREED) constructor\n;
101:   }
102:
103:   Dog::Dog(int age, BREED breed):
104:   Mammal(age),
105:   itsBreed(breed)
106:   {
107:      cout << Dog(int, BREED) constructor\n;
108:   }
109:
110:   Dog::~Dog()
111:   {
112:      cout << Dog destructor\n;
113:   }
114:   int main()
115:   {
116:      Dog fido;
117:      Dog rover(5);
118:      Dog buster(6,8);
d5ef64f4d3250b96ba5c07ca5bbc2f56.gif
continues

 
< previous page page_258 next page >

If you like this book, buy it!