Hi
anyone can help me to understand following sample example code for linked list
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;
}
There are two structures in code I understand structure Node is use for Nodes but I don't have any idea of second structure LinkedList
Code:
struct LinkedList List = {NULL, NULL};
I am confused in above line of code. List is pointer but It's initialized two times with NULL value