4
I was suggested to build a chained list using the following struct
knotted:
typedef struct node *link;
struct node{
int item;
link next;
};
As I did not understand what the pointer operator means along with this typedef
I researched and ended up thinking that in this case link
becomes an alias for pointers to the structure node
. Knowing this I started to create the list based on this idea, but at first I found errors, the code is compiled correctly, but the execution window hangs soon after.
Code that I’m starting:
int main ()
{
link l;
l->next = NULL;
}
I suppose I am using the "nickname" of the Node pointer erroneously. What is the correct way to use it?