Example of list class use.
There is no easy way to initialise a list so we'll just set it from the strings array.
A dummy pointer of type EST_Litem is used to iterate through a list. This acts somewhat like the index in an array in that it is used to access an item, in the list but does not contain a value itself.
Iteration is usually done in a for loop. Initialisation involves setting the pointer to the head() function. Increments are done by the next() function. At the end of the list, the pointer will be set to null, and this can be used to check for the end.
Items in the list are accessed by passing the pointer is as the argument to the function operator(), as in the following example.
The normal way to access an item is to use the EST_Litem in conjunction with the () operator. Other functions also exist, eg. EST_TList::first(), EST_TList::last() and EST_TList::nth(). Const and non-const version of each access function exist, allowing both reading and writing.
Removing items from lists is done by having the EST_Litem point to a particular item, and then passing this pointer to the remove function. This can be tricky as this leaves the EST_Litem pointer pointing to a non-existent item. To get round this, the EST_TList::remove() function returns a pointer to the previous item in the list.
A number of sort routines for lists are defined. The most useful are probably sort (a simple bubble sort, quick for small lists) and qsort (quick-sort, faster for long lists).
If the default collation order is not what you want you can pass a comparison operator to the sort routine.
Compares the second character of Strings.