-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstlast_bonus.c
27 lines (24 loc) · 1.05 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
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstlast.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hmoumani <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/01 00:33:59 by hmoumani #+# #+# */
/* Updated: 2019/11/03 00:14:57 by hmoumani ### ########.fr */
/* */
/* ************************************************************************** */
#include "lib.h"
t_list *ft_lstlast(t_list *lst)
{
t_list *curr;
if (!lst)
return (NULL);
curr = lst;
while (curr->next != NULL)
{
curr = curr->next;
}
return (curr);
}