August 2012
Intermediate to advanced
976 pages
30h 17m
English
A derived class must specify from which class(es) it inherits. It does so in its class derivation list, which is a colon followed by a comma-separated list of names of previously defined classes. Each base class name may be preceded by an optional access specifier, which is one of public, protected, or private.
A derived class must declare each inherited member function it intends to override. Therefore, our Bulk_quote class must include a net_price member:
class Bulk_quote : public Quote { // Bulk_quote inherits from Quote Bulk_quote() = default; Bulk_quote(const std::string&, double, std::size_t, double); ...
Read now
Unlock full access