October 2004
Intermediate to advanced
336 pages
6h 27m
English
This code removes an entry from an ordered, singly linked list. It follows up on the previous example of a linked list of structures ordered by a key value. The structure is defined the same way:
typedef struct _entry {
int key;
int data;
char name[20];
struct _entry * next;
} entry, * entry_ptr;
The head of the linked list is saved in a pointer that is stored outside the list itself. Within the list, the next pointer in each entry points to the next element in the list; the end of the linked list is denoted by a NULL next pointer. Entries with a lower key value appear earlier in the list.
When passed a key value to look ...
Read now
Unlock full access