Computer Algorithms II Class Notes

Computer Algorithms II Lecture Notes

11 September 2007 • Dynamic Storage and C++


Outline

Dynamic Storage

The STL and Other Libraries

  • The other possibility is to use dynamic storage.

    Dynamic Storage and Classes

  • Dynamic storage and classes are not a match made in heaven

    Compile-Time Allocation

    Compile-Time Problems

    Example

    An Anti-Example

    The Example Reworked

    Class and Pointers

    Destructors and Pointers

    Classes and Pointers II

    Class Instance Copying

    The Copy Constructor

    Copying Data

    Classes and Pointers III

    Class Instance Assignment

    Assignments

    The Assignment Operator

    assignment storage management

    Assignment Fine Points

    Self Assignment

    The Self-Assinment Problem

    Handling Self-Assignment

    Assignments as Expressions

    Assignment Prototype

    Seeming Assignments

    Assignment vs. Copying

    Assigning and Copying

    The Rule of Three

    Points to Remember


    This page last modified on 16 September 2007.

    This work's CC license.