R
r.devaraj
consider foll. piece of code.
struct node{
int data;
struct node *next;
};
struct node *list; (say the list as 1->2->3)
printf("%d%p",list,&list);
list holds address of node 1. list->next contains address of 2.
&list tells the space allocated for list itself.
i couldn't get what is the value of &(list->next) and what it
signifies?
is it the place where address of 2 is stored??
Why it need to be stored additional to node 2 and how it is got back?
elaborate plz.
Thanks.
Deva.
struct node{
int data;
struct node *next;
};
struct node *list; (say the list as 1->2->3)
printf("%d%p",list,&list);
list holds address of node 1. list->next contains address of 2.
&list tells the space allocated for list itself.
i couldn't get what is the value of &(list->next) and what it
signifies?
is it the place where address of 2 is stored??
Why it need to be stored additional to node 2 and how it is got back?
elaborate plz.
Thanks.
Deva.