Previous Page
Next Page

Chapter 9. Pointers

A pointer is a reference to a data object or a function. Pointers have many uses: defining "call-by-reference" functions, and implementing dynamic data structures such as chained lists and trees, to name just two examples.

Very often the only efficient way to manage large volumes of data is to manipulate not the data itself, but pointers to the data. For example, if you need to sort a large number of large records, it is often more efficient to sort a list of pointers to the records, rather than moving the records themselves around in memory. Similarly, if you need to pass a large record to a function, it's more economical to pass a pointer to the record than to pass the record contents, even if the function doesn't modify the contents.


Previous Page
Next Page