Next: Multidimensional arrays and pointers Up: Pointers Previous: Pointers and Arrays

Arrays of Pointers

We can have arrays of pointers since pointers are variables.

Example use:

Sort lines of text of different length.

NOTE: Text can't be moved or compared in a single operation.

Arrays of Pointers are a data representation that will cope efficiently and conveniently with variable length text lines.

How can we do this?:

Fig. Arrays of Pointers (String Sorting Example)

This eliminates:


Dave.Marshall@cm.cf.ac.uk
Fri May 20 13:40:49 BST 1994