I am studying code examples from my professor in order to become better acquainted with linked data structures.
In our linked-list.c example the professor defines a
Here struct node
is a type like int
and Hence
struct node {
int data;
struct node *next;
}NodeVar;
means you are declaring a single variable Node of struct node.
like int intVar;
typedef is to make your code understandable.
so that when you use
typedef struct node Node;
you can use the same declaration as
Node NodeVar;