Lecture Notes for Advanced Programming II

2 April 2002 - Dynamic Memory and Classes


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


This page last modified on 4 April 2002.