CS 70

Lesson Two

  • LHS Cow speaking

    Today is a really exciting day!

  • Dog speaking

    Really? Why?? I am so excited!!

  • LHS Cow speaking

    Because today we'll learn how to allocate memory outside of a stack frame, so it can persist after a function returns!

  • Dog speaking

    Oh, boy! Oh, boy! This is gonna be great!

  • LHS Cow speaking

    We will also learn more about pointers and see how important they are in C++ (and in other languages).

  • RHS Cow speaking

    It turns out that pointers are really fundamental to lots of what you've done in CS so far, though you probably didn't know it!

This lesson will address the following goals in Group 4:

  • Goal 4B (Pointers):
    • Read, write, and visualize C++ code involving
      • Pointers
      • The indirection operator (*)
      • The index operator ([ ])
      • new, and delete
  • Goal 4C (Memory Management):
    • Recognize memory management issues; specifically,
      • Dangling pointers
      • Double deletes
      • Memory leaks
    • How to correct these issues

Outline

(This is a good spot for a break, if you feel like it!)

To receive credit: complete all pages above, then this page will be complete as well (and get a green check emoji at the bottom right of the page).

(When logged in, completion status appears here.)