- The array model of memory
- Memory is an array of units (words, bytes).
- Variables get mapped into a contiguous sequence of memory units.
- Pointers
- The memory-unit indices are also know as pointers.
- The distinguished null pointer.
- Pointer Variables
- You can declare variables that hold pointer values.
- This recursion can go on for ever, but probably shouldn't.
- Pointer variables are, for the most part, just like all other
variables.
- Pointer operations
- Find the address of variables
- Follow addresses to get values
- Compare pointers to one another
- Pointer arithmetic
- Scaled arithmetic
- Pointer difference
- Pointer operation idioms
- array access
[]
.
- member field access
->
.
- Pointers as procedure parameters.
- Call-by-value semantics.
- Passing values back out of the function.
This page last modified on 17 October 2003.