Finally the killList() function frees up all of the memory in the list. The great thing with pointers is that you are free to construct sophisticated and complex data storage methods according to your needs. Let me say though, that apart from the interesting exercise of writing your own, there are several open source or free libraries that have well tested code and you may save considerable time (and hair) not having to debug your own. I've added one set (ubiqx) to the C code library.
Data Structures
This list is useful for storing items in memory and processing them by one by one. It's not so good say for accessing any individual element directly (called random access) as getting an element out of the list requires that you have to count forward from the head which slows it down. You could add this functionality by creating an index array of pointers and as each element is added to the list, use the id to store each element's address in this array.It really depends on how you intend to use the storage- do you want random or serial access, fast addition and removal of elements etc? This is where the different storage data structures can be used. Some databases use binary trees for fast access.
On the next page : Function Pointers

