One aspect of programming which many students find difficult is pointers. Put simply, pointers are variables which store addresses. Below, you will find an applet which will introduce a few of the fundamentals of pointers, as well as a few warnings of pitfalls to avoid when using pointers. The applet includes sample code in C, sample output, explanations of the lines of code, and a simulation of what is happening in memory.
To change between pointer concepts illustrated by the applet, click on the pull-down menu which begins with “Basic Pointers” and select a new concept from the list. New program code will appear in the program code window.
There are three ways to move through the program code:
To change between decimal, binary, hexadecimal, and ASCII notation as displayed in the simulation of memory on the right side of the applet, click on the pull-down menu which begins with “Decimal” and select a new notation from the list. Upon changing notation, the line of code active in the code window will return to the first line of the code, and the representation of values stored in memory and memory addresses changes to the correct notation type.