Hi all!
I don't know what's wrong with my code. The program behaves as if the if-memchr-line wouldn't exist. Perhaps there's a problem with passing the next struct (p) in the linked llist, while running the loop many times?
Thanks in advance for help!
Code:while(!feof(fp)) { fgets(buf, 750, fp); if(memchr(buf, '~', 750)) { if(head) { if(save==1) { Print(head); } Delete(head); } head = malloc(sizeof *head); p=malloc(sizeof(struct node)); head->next=p; save=0; } Build_linked_list(p); }