/* is the following a good example of a linked list and if not why */
#include<stdio.h>
#include<conio.h>
struct linkedlist{
int a,b,c;
struct linkedlist *next_linkedlist;
};
int main()
{
struct linkedlist list,*ptr; /* pointer to structure */
ptr=&list; /* of type linkedlist */
ptr->a=10; /* pointer points to first data member/variable a */
ptr->next_linkedlist->a=37; /* pointer now points to the next */
/* structure then it's first data member which is a */
printf("%d",ptr->a); /* output 10 */
printf("\n%d",ptr->next_linkedlist->a); /* output 37 */
getch();
return 0;
}
/* The identifier a has been used twice in the above code */
/* has it been used correctly, To create more lists would */
/* I do this in the outer most structure add more statements */
/* like so struct linklist *next1_linkedlist; */
/* struct linklist *next2_linkedlist; */
/* ... */
/* ... */
/* ... */
/* Therefor being able to use a,b,c over and over and... */
/* But if all these pointers point to abc how come there not */
/* overwriten */
thanks for all the help