Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. void list_insert(node** head, char* s)
  2. {
  3. node* n = list_new();
  4. n->string = s;
  5. n->next = NULL;
  6.  
  7. if (*head == NULL) {
  8. *head = n;
  9. return;
  10. }
  11.  
  12. node* tmp = *head;
  13.  
  14. while (tmp->next != NULL) {
  15. tmp = tmp->next;
  16. }
  17.  
  18. tmp->next = n;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement