Академический Документы
Профессиональный Документы
Культура Документы
Example
We would like to keep a list of inventory
records but only as many as we need
} inventory_item_t;
Defining the Structure
typdef struct inventory_item_s {
char name[80];
int number;
double cost;
int num_in_inventory;
struct inventory_item_s *next;
} inventory_item_t;
Typical Linked List
head: Item 1 Item 2 Item 3 Item N
NULL
Traversing a List
head: Item 1 Item 2 Item 3 Item N
NULL