| | Linked lists are often the best choice when trying to create memory-efficient algorithms. Previous programs involving arrays of structures (see Chapter 9 and 13, for example) have all included definitions for the total number of structures used. For example, MAX_BOATS might be set to 25. This means that the program can accept data for a maximum of 25 boats. If 70 or 100 boats are brought into the marina, the program itself will have to be altered and recompiled to accommodate the increased number. This is because the structure allocation is static (do not confuse this with the storage class modifier—static). Static used in this sense means a variable that is created by the compiler at compile time. These types of variables exist for their normal scope and the programmer cannot create more of them, or destroy any of them, while the program is executing. The disadvantage of static allocation should be immediately clear. | | |