In this code snippet for adding to a Linked List, what is if (List==NULL) doing? I tried to throw some inputs at it to see if I could engage that statement with no luck. What type of input would work?
main()
{
struct Node *List;
List = NULL;
append (&List, 5);
}
void append(struct Node **List, int num)
{
if (List == NULL)
{
return;
}
if (*List == NULL)
{
*List = malloc(sizeof(struct Node));
(*List)->data = num;
(*List)->next = NULL;
}
//some additional cases edited out for brevity
}