“A silly but memorable 3 minute animated video demonstrating the basic structure, techniques, and pitfalls of using pointers. There are separate versions of the video for C, Java, C++, Pascal, and Ada. There is also a more traditional companion text (below) that goes with the video, and a brief history of how the video was made” (Stanford CS Education Library, 2006). The videos stars Binky, a blue Claymation character, who demonstrates how pointer variables contain memory addresses, which refer to pointees, which are items such as other variables, arrays, structures, or objects. It also illustrates how to use the dereferencing operator to store values in the pointees via the pointers. At one point, Binky forgets to create a pointee and tries to use a pointer, which does not point anywhere, i.e., to another memory location, causing him to explode, well, at least to fall apart. 🙂 At the end, it reviews the three pointer rules:
- Pointer and pointee are separate — don’t forget to set up the pointee.
- Dereference a pointer to access its pointee.
- Assignment (=) between pointers makes them point to the same pointee (Stanford CS Education Library, 2006).
Besides having different versions of the video for the different programming languages, there are two different sizes of each video, i.e., “small (300 x 320, 14 Megabytes) and large (640 x 480, 34 Megabytes)” (Stanford CS Education Library, 2006). I have provided the small C version below.