When Constructors and Destructors Are Called

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












Figure 10: CreateAndDestroy class definition.
\includegraphics[scale=0.45]{figures/img58.ps}
Figure 11: CreateAndDestroy class member-function definitions.
\includegraphics[scale=0.45]{figures/img59.ps}
\includegraphics[scale=0.45]{figures/img60.ps}
Figure 12: 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 13: 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-01