I studying how to create linked lists in C. Take a look at this article.
First he creates the structure using the following code;
struct node
{
int data;
struct node *next;
};
Its clear that *next is a pointer variable of the type node.
But when he goes forward, he does this;
struct node* head = NULL;
struct node* second = NULL;
struct node* third = NULL;
Now here I have a problem comprehending what he is trying to do; is he creating nodes of the names, head, second and third? or he is simply trying to create pointer variables of the type node?
Since he puts them equal to NULL; I'd assume he is trying to create pointer variables. But couldn't he do the same using this?
struct node *head = NULL;
struct node *second = NULL;
struct node *third = NULL;
Thanks