May 2002
Beginner
320 pages
6h 18m
English
As you've seen, a derived class cannot use member variables and functions declared in the private section of the superclass. But a superclass can offer functions and member variables that only the superclass and its derived classes can use, putting them in a special protected section.
The declaration of anExternalInterface in Listing 22.4 shows some of the changes needed to make it ready for inheritance, including placing two functions in the protected section so that they can be overridden by aPersistentTapeExternalInterface.
1: #ifndef ExternalInterfaceModuleH 2: #define ExternalInterfaceModuleH 3: 4: #include "RequestModule.h" 5: 6: namespace SAMSCalculator 7: { 8: class ... |
Read now
Unlock full access