CS 70

Before You Start…

What are the five phases of any object's lifetime in C++?

Remember from way back at the beginning of the semester—all objects go through the same phases of object lifetime!

The five phases are

  1. Allocation
  2. Initialization
  3. Use
  4. Destruction
  5. Deallocation
  • LHS Cow speaking

    We can separately think about when each stage of object lifetime happens and how each stage of object lifetime happens.

  • RHS Cow speaking

    Today we're going to do just that!

  • LHS Cow speaking

    We'll also separate out how arrays, references, and data members interact with object lifetime.

  • RHS Cow speaking

    Strictly speaking, there's very little new in today's lesson.

  • LHS Cow speaking

    Instead, we're going to take some time to sort through the ideas you've already seen, to make sure they're clear before we move on to writing our own data structures.

(When logged in, completion status appears here.)