Our goal is to demonstrate several very important subtleties in the C++ model for objects. In particular, we wish to address
Scope and lifespan of variables
Various syntax for constructing objects
Parameter Passing Models
References, Pointers and Objects
In order to address each of these, we closely examine some simple code which demonstrates the range of issues. We will step through a simulated execution of this code, trying to gain intuition for precisely what happens in the underlying memory as each individual command executes. A sanitized version of this code was provided as a handout in class.
We also ran a live demo of software which simulates the above
code while displaying a wealth of intermediate state information to the
user along the way. For those interested, the
actual code we used for this demo in class is available at
turing.slu.edu:/public/goldwasser/180/demo/objectdemo/