<<< Constructing a derived class | Index | Access levels for inheritance >>> |
// Base
class Account {
public:
Account( int bal );
};// class Account
// Derived
class GoldAccount : public Account {
public:
GoldAccount( int bal );
private:
int m_margin_balance;
};// class GoldAccount
// Derived constructor invokes base constructor:
GoldAccount::GoldAccount( int bal )
: Account( bal ),
m_margin_balance( 0 )
{
}
<<< Constructing a derived class | Index | Access levels for inheritance >>> |