Friends;
Just help me. I became unable during thesepast more than weeks to solve my Circular Linked List program, although I did it simply linked List.
Just send me, initializenode(), insertnode() and printnode() functions for CIRCULAR LINKED LIST. I think then, Iwill be able to make delete, save, modify and search functions......
For references you can see my previous posts and my overall program, ...Modify it if anyone can .......
// struct type ...
struct node {
char name[20];
int id[10];
struct node *next;
} List;
// function prototype ....
void insertnode( List *)
main()
.....
void insertnode( List *insert )
{
List *cur, *tail;
List *myList;
cur = tail = myList;
do {
if(strcmp(cur->name,insert->name)<0)
{
cur = cur->next;
}
else
break;
} while(cur != tail);
/* insert after the end */
if ( cur == tail)
{
insert->next = myList;
tail->next = insert;
}
/* insert after cur */
else
{
insert->next=cur->next;
cur->next=insert;
}
}
***COMPILE ERROR Message ****
parse error before `*'
mycll.c:69: parse error before `*'
mycll.c: In function `insertnode':
mycll.c:71: `cur' undeclared (first use in this function)
mycll.c:71: (Each undeclared identifier is reported only once
mycll.c:71: for each function it appears in.)
mycll.c:71: `tail' undeclared (first use in this function)
mycll.c:72: `myList' undeclared (first use in this function)
mycll.c:75: `insert' undeclared (first use in this function
Can again anyone point where I did mistake......
BYE!!!!