October 2004
Beginner
408 pages
9h 24m
English
The problem with static arrays (like the array of structures in our previous example) is that they can have only a finite number of elements. This value is set during compilation, meaning that when you write the program, you must know and set the maximum number of elements to ever be stored. In Chapter 10, “Managing Memory,” you learned how to make a dynamically sized array using realloc(), which increased the amount of available memory as needed. Linked lists allow you to combine these two concepts, creating a growing list of structures.
A linked list takes structures one step further by making them self-referential. This is accomplished by defining a structure as containing both data (the actual information being ...