libft
src
ft_lstlast.c
Go to the documentation of this file.
1
/* ************************************************************************** */
3
/* */
4
/* ::: :::::::: */
5
/* ft_lstlast.c :+: :+: :+: */
6
/* +:+ +:+ +:+ */
7
/* By: unite <marvin@42.fr> +#+ +:+ +#+ */
8
/* +#+#+#+#+#+ +#+ */
9
/* Created: 2019/09/20 21:43:42 by unite #+# #+# */
10
/* Updated: 2020/07/16 03:01:56 by unite ### ########.fr */
11
/* */
12
/* ************************************************************************** */
13
14
#include "
libft.h
"
15
22
t_list
*
ft_lstlast
(
t_list
*lst)
23
{
24
if
(!lst)
25
return
(NULL);
26
while
(lst->
next
)
27
lst = lst->
next
;
28
return
(lst);
29
}
s_list
A link in a multi-purpose linked list.
Definition:
libft.h:34
ft_lstlast
t_list * ft_lstlast(t_list *lst)
Returns the last element of a list.
Definition:
ft_lstlast.c:22
s_list::next
struct s_list * next
The next link’s address or NULL if it’s the last link.
Definition:
libft.h:38
libft.h
Generated by
1.8.16