July 2000
Intermediate to advanced
1280 pages
34h 55m
English
The core of using C++ inheritance is the colon that follows the name of the derived class. It denotes the place for the name of the base class and for the description of the mode of inheritance—public, private, or protected.
Listing 13.4 shows the same program as in Listing 13.3 but is implemented with the use of inheritance. The client code is the extension of the client code in Listing 13.3. This is why the output of this program (shown in Figure 13-3) is the extension of the output of the program in Listing 13.3.
#include <iostream> using namespace std; class Account { // base class of hierarchy protected: double balance; public: Account(double ... |
Read now
Unlock full access