tgrekov-libft
HIVE libft Oct 2023
Loading...
Searching...
No Matches
ft_lstlast_bonus.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_lstlast_bonus.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2023/10/28 01:21:38 by tgrekov #+# #+# */
9
/* Updated: 2023/11/06 12:19:36 by tgrekov ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
20
#include "
libft.h
"
21
28
t_list
*
ft_lstlast
(
t_list
*lst)
29
{
30
if
(!lst)
31
return
(0);
32
while
(lst->
next
)
33
lst = lst->
next
;
34
return
(lst);
35
}
ft_lstlast
t_list * ft_lstlast(t_list *lst)
Get the last node in a list.
Definition
ft_lstlast_bonus.c:28
libft.h
s_list
Linked list node.
Definition
libft.h:44
s_list::next
struct s_list * next
Pointer to the next node.
Definition
libft.h:46
ft_lstlast_bonus.c