Hi there..
I have a simple question.
How do you send the pointer back to the start of one's list after creating it..
I have this:
typedef struct myitem
{
char *listitem;
struct myitem *next;
} MYLIST;
I use the function:
void slstore(struct myitem *i)
{
static struct myitem *last=NULL;
if(!last) last = i;
i->next = NULL;
last = i;
}
to store my items into the list..
I want to use
void display(struct myitem *top)
{
while (top){
printf("%s\n",top->listitem);
top = top->next;
}
}
But I guess I need to put the pointer back to the start of the list before calling display..
Any ideas on how to do that?
//kor