Lecture Notes for Advanced Programming II

25 March 2004 - Dynamic Memory and Classes


Outline


Dynamic Memory and Classes


Use Statically Allocated Memory


Static Allocation Example


Another Static Allocation Example


Class Destructors


Class Instance Copying


The Copy Constructor


Class Instance Assignment


The Assignment Operator


The Self-Assignment Problem


Solving the Self-Assignment Problem


Assignments as Expressions


Assignment vs. Copying


The Rule of Three


Points to Remember


This page last modified on 23 March 2004.