-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstlast_bonus.c
25 lines (22 loc) · 1.12 KB
/
ft_lstlast_bonus.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstlast_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: atoof <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/23 11:40:36 by atoof #+# #+# */
/* Updated: 2022/11/23 12:08:45 by atoof ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstlast(t_list *lst)
{
t_list *currentelement;
currentelement = lst;
if (currentelement == NULL)
return (NULL);
while (currentelement ->next != NULL)
currentelement = currentelement->next;
return (currentelement);
}