It should be no surprise from our diagram of a linked list that we need two structures – a linked list header structure and a list node structure. These are defined as follows:
typedef struct _Node ListNode;
typedef struct _Node {
ListNode* pNext;
ListData* pData;
} ListNode;
typedef struct {
ListNode* pFirstNode;
intnodeCount;
} LinkedList;
First, we define an arbitrary tag, struct _Node, as a ListNode structure. This is a naming mechanism so that we can use the name ListNode in the following structure definition with the members of struct _Node. The struct _Node tag contains a ListNode pointer and a ListData pointer, both of which will be known henceforth as simple ListNode custom types. We won't need to use struct _Node again. Our list will consist of zero or more ListNode.
Next, we define a heading for our linked list, LinkedList, which consists of a ListNode pointer and an int element to keep track of the number...