So we have a struct that is actually representing a node of a linked list. Also a pointer that points to node.
typedef struct node{
int value;
struct node *next;
}node;
node* head=NULL;
If I am going to dynamically allocate the pointer using malloc,
head=malloc(sizeof(node));
that means that I am creating some memory space, with size of node, and head is pointing at it.
I would like to know the difference between this head=malloc(sizeof(node*));
, as you can see in the sizeof it has node* instead of node. Now I really think that all this time I had no idea what malloc really does!