From 7a34b3d412f5022d4ce25d84ec7fb4002b1fb5db Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Sat, 21 Feb 2026 17:33:28 +0100 Subject: Implement libft Part 3 (linked lists) with tests Add t_list struct and 9 linked list functions: ft_lstnew, ft_lstadd_front, ft_lstsize, ft_lstlast, ft_lstadd_back, ft_lstdelone, ft_lstclear, ft_lstiter, ft_lstmap. --- src/ft_lstlast.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/ft_lstlast.c (limited to 'src/ft_lstlast.c') diff --git a/src/ft_lstlast.c b/src/ft_lstlast.c new file mode 100644 index 0000000..68b6337 --- /dev/null +++ b/src/ft_lstlast.c @@ -0,0 +1,11 @@ +#include "libft.h" + +t_list * +ft_lstlast (t_list *lst) +{ + if (!lst) + return (NULL); + while (lst->next) + lst = lst->next; + return (lst); +} -- cgit v1.2.3