When Constructors and Destructors Are Called

The program of Figs. 1.22-1.25 demonstrates the order in which constructors and destructors are called for objects of class CreateAndDestroy of various storage classes in several scopes.












Figure 1.22: CreateAndDestroy class definition.
\includegraphics[scale=0.45]{figures/img58.ps}
Figure 1.23: CreateAndDestroy class member-function definitions.
\includegraphics[scale=0.45]{figures/img59.ps}
\includegraphics[scale=0.45]{figures/img60.ps}
Figure 1.24: Order in which constructors and destructors are called. (part 1 of 2)
\includegraphics[scale=0.45]{figures/img61.ps}
\includegraphics[scale=0.45]{figures/img62.ps}
Figure 1.25: Order in which constructors and destructors are called. (part 2 of 2)
\includegraphics[scale=0.45]{figures/img63.ps}
\includegraphics[scale=0.45]{figures/img64.ps}
2004-07-29