saving . . . saved data structure non continuous linked list problem... has been deleted. data structure non continuous linked list problem... has been Shown .
data structure non continuous linked list problem...
Title
Question
i have a code that i dont understand partially the code is as follows:-
(Toggle Plain Text)
#include<conio.h>
#include<stdio.h>
struct node
<span style="white-space:pre">\t</span>{
<span style="white-space:pre">\t\t</span>int info;
<span style="white-space:pre">\t\t</span>struct node *next;
<span style="white-space:pre">\t</span>};
<span style="white-space:pre">\t</span>typedef struct node node;
int main()
{
<span style="white-space:pre">\t</span>node n1,n2,n3,n4,*p;
<span style="white-space:pre">\t</span>p=&n1;
<span style="white-space:pre">\t</span>n1.info=10;
<span style="white-space:pre">\t</span>n2.info=20;
<span style="white-space:pre">\t</span>n3.info=25;
<span style="white-space:pre">\t</span>n4.info=16;
<span style="white-space:pre">\t</span>n1.next=&n2;
<span style="white-space:pre">\t</span>n2.next=&n3;
<span style="white-space:pre">\t</span>n3.next=&n4;
<span style="white-space:pre">\t</span>n4.next=NULL;
<span style="white-space:pre">\t</span>while(p!=NULL);
<span style="white-space:pre">\t</span>{
<span style="white-space:pre">\t\t</span>printf("%d",p->info);
<span style="white-space:pre">\t\t</span>p=p->next;
<span style="white-space:pre">\t</span>}
<span style="white-space:pre">\t</span>getch();
}
it says no error but it did not ran......
things i dont understand is -> sign and concept of self refrential (node *next) structure i know how a linked list works but there are these few queries




For more details :  <a href="https://blog.advids.co/20-brilliant-teaser-trailer-examples-worth-watching/" target="" title="">teaser trailer</a>

Advance-C General None min None sec 14-11-17, 6:29 p.m. JensenBreck

Answers:

Log-in to answer to this question.