 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
#include
"account.h"
|
|
account::account()
: balance(0) {
|
|
strncpy(name, "none", 32);
|
|
name[31] = '\0';
|
|
cout <<"account constructor
called" <<endl;
|
|
}
|
|
checking::checking()
: charges(5) {
|
|
cout <<"checking constructor
called" <<endl;
|
}
|
|
savings::savings()
: interest(0) {
|
|
cout <<"savings constructor
called" <<endl;
|
|
}
|
|
After
the client saying: checking c;
|
|
savings
s;
|
|
|
account
constructor called
|
|
checking
constructor called
|
|
account
constructor called
|
|
savings
constructor called
|
|