Can anyone please explain this?
struct node
{
int data;
struct node * link;
}
main()
{
struct node *p, *list, *temp;
list = p = temp = NULL;
.........................
.........................
}
addbeg()
{
int x;
temp=malloc(sizeof(struct node));
scanf("%d", &x);
temp->data=x;
temp->link = list;
list=temp;
}
This is a code for entering data in linkedlist through 'C' language.The code is not complete, but, I think its enough for the purpose. Please explain the coding basically these lines:
temp=malloc(sizeof(struct node));
and
temp->link = list;
list=temp;.