|
|
|
|
|
|
|
Figure 16-8
The Slicing Problem Resulting from Pass-by-Value |
|
|
|
|
|
|
|
|
Suppose we make one small change to our Time class declaration: we begin the declaration of the Write function with the reserved word virtual. |
|
|
|
|
|
|
|
|
class Time
{
public:
.
.
.
virtual void Write() const;
.
.
.
|
|
|
|
|
|