diff options
Diffstat (limited to 'src/lst/ft_lstlast.c')
| -rw-r--r-- | src/lst/ft_lstlast.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/lst/ft_lstlast.c b/src/lst/ft_lstlast.c new file mode 100644 index 0000000..247f4da --- /dev/null +++ b/src/lst/ft_lstlast.c @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstlast_bonus.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/10/09 09:03:40 by cacharle #+# #+# */ +/* Updated: 2019/11/20 04:02:26 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +t_list *ft_lstlast(t_list *lst) +{ + if (lst == NULL) + return (NULL); + while (lst->next != NULL) + lst = lst->next; + return (lst); +} |
