-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstlast.c
29 lines (26 loc) · 1.12 KB
/
ft_lstlast.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
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstlast.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rdragan <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/05 18:09:15 by rdragan #+# #+# */
/* Updated: 2022/11/05 18:12:23 by rdragan ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
Returns the address of the last node of the list
@param lst: beginning of the list
*/
t_list *ft_lstlast(t_list *lst)
{
t_list *temp;
if (!lst)
return (NULL);
temp = lst;
while (temp->next)
temp = temp->next;
return (temp);
}