Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. MultiLinkedList *removeItem(MultiLinkedList *list, char *first, char *last)
  2. {
  3. // remove the individual specified from the list
  4. Node *c=malloc(sizeof(Node));
  5. c->nextFirst=list->headFirstName;
  6. c->nextLast=list->headLastName;
  7. while(c->nextFirst!=NULL || c->nextLast!=NULL)
  8. {
  9. if(c->nextFirst!=NULL)
  10. {
  11. c=c->nextFirst;
  12. }
  13. else if(c->nextLast!=NULL)
  14. {
  15. c=c->nextLast;
  16. }
  17.  
  18. if((strcasecmp(c->first, first)==0) && (strcasecmp(c->last, last)==0))
  19. {
  20. c->nextLast=c->nextLast->nextLast;
  21. c->nextFirst=c->nextFirst->nextFirst;
  22. }
  23. }
  24. return list;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement