From 4e2e8aac225f2a226573ae36e5327a8c4073bbbc Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 8 Oct 2019 18:19:36 +0200 Subject: Added bonus functions WIP --- ft_lstadd_back.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ft_lstadd_back.c (limited to 'ft_lstadd_back.c') diff --git a/ft_lstadd_back.c b/ft_lstadd_back.c new file mode 100644 index 0000000..e2cbf2a --- /dev/null +++ b/ft_lstadd_back.c @@ -0,0 +1,17 @@ +#include +#include "libft.h" + +void ft_lstadd_back(t_list **alst, t_list *new) +{ + t_list *cursor; + + if (*alst == NULL) + { + *alst = new; + return ; + } + cursor = *alst; + while (cursor->next != NULL) + cursor = cursor->next; + cursor->next = new; +} -- cgit