-
Notifications
You must be signed in to change notification settings - Fork 4
/
ft_lstlast.c
27 lines (24 loc) · 1.05 KB
/
ft_lstlast.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstlast.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aalvarez <aalvarez@student.1337.ma> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/26 19:25:31 by aalvarez #+# #+# */
/* Updated: 2024/06/26 19:26:06 by aalvarez ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstlast(t_list *lst)
{
t_list *last;
last = NULL;
if (lst != NULL)
{
last = lst;
while (last->next)
last = last->next;
}
return (last);
}