If you're dealing with a linked list that has both head and tail, then I would suggest something like this:
Code:
struct Node
{
int Value;
struct Node *Next;
};
struct LinkedList
{
struct Node *Head;
struct Node *Tail;
};
void appendNode(struct LinkedList *List, int value)
{
/* ... */
}
int main(void)
{
struct LinkedList List = {NULL, NULL};
appendNode(&List, 123);
/* destroy the linked list when done
... */
return 0;
}
The reason for struct LinkedList is that sometimes the linked list operation might change the head, other times it might change the tail, so generally you have to pass both (and when you do expect either to change rather than merely what they point to to change, the parameter will have to be a pointer to a pointer). This thus simplifies the process by introducing another level of abstraction.