Chapter 17
1: | What's involved in defining a data type? |
A1: | Defining a data type consists of deciding how to store the data and of designing a set of functions to manage the data. |
2: | Why can the linked list in Listing 17.2 be traversed in only one direction? How could you modify the struct film definition so that the list could be traversed in both directions? |
A2: | The list can be traversed in only one direction because each structure contains the address of the next structure, but not of the preceding structure. You could modify the structure definition so that each structure contains two pointers, one to the preceding structure and one to the next structure. The program, of course, would have to assign proper addresses to these pointers each time ... |
Get C Primer Plus, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.