Libft
42 Libft library documentation
Loading...
Searching...
No Matches
ft_lstlast.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_lstlast.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: raphalme <raphalme@student.42.fr> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2025/12/29 19:18:00 by raphalme #+# #+# */
9
/* Updated: 2026/04/14 10:36:21 by raphalme ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include <stdlib.h>
14
#include "../includes/types.h"
15
23
t_list
*
ft_lstlast
(
t_list
*lst)
24
{
25
if
(!lst)
26
return
(NULL);
27
while
(lst->
next
)
28
lst = lst->
next
;
29
return
(lst);
30
}
ft_lstlast
t_list * ft_lstlast(t_list *lst)
Returns the last element of a linked list. This function takes a linked list and returns a pointer to...
Definition
ft_lstlast.c:23
s_list
Definition
types.h:4
s_list::next
struct s_list * next
Definition
types.h:6
src
ft_lstlast.c
Generated by
1.9.8