CMSC 202 Computer Science II, Spring 2016, Section 01
Lecture 13: Constructors & Destructors
Thu 03/10, 2016
[Up]
[Previous Lecture]
[Next Lecture]
Assigned Reading:
Slides As Shown:
Topics Covered:
- Memory allocation and destructors:
Examples:
-
A class DMC with a dynamically allocated array:
dmc.h,
dmc.cpp.
-
A simple example with destructors being invoked when objects
go out of scope:
main1.cpp.
-
Destructors and loops:
main2.cpp.
-
Temporary objects in expressions:
main3.cpp.
-
DMC as data member in AClass:
main4.cpp.
[UMBC] |
[CSEE] |
[CMSC202] |
[CMSC202-06]
Last Modified:
22 Jul 2024 11:29:13 EDT