Using Default Arguments with Constructors

The program of Figs. 1.17-1.21 enhances class Time to demonstrate how arguments are implicitly passed to a constructor.









Figure 1.17: Time class containing a constructor with default arguments.
\includegraphics[scale=0.5]{figures/img47.ps}
Figure 1.18: Time class member-function definitions including a constructor that takes arguments. (part 1 of 2)
\includegraphics[scale=0.45]{figures/img48.ps}
\includegraphics[scale=0.45]{figures/img49.ps}
Figure 1.19: Time class member-function definitions including a constructor that takes arguments. (part 2 of 2)
\includegraphics[scale=0.5]{figures/img50.ps}
Figure 1.20: Constructor with default arguments. (part 1 of 2)
\includegraphics[scale=0.45]{figures/img51.ps}
\includegraphics[scale=0.45]{figures/img52.ps}
Figure 1.21: Constructor with default arguments. (part 2 of 2)
\includegraphics[scale=0.45]{figures/img53.ps}
2004-07-29