Push the final version
This commit is contained in:
commit
d0fe1fb2fb
28 changed files with 1459 additions and 0 deletions
27
libft/ft_lstlast.c
Executable file
27
libft/ft_lstlast.c
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_lstlast.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/13 12:07:33 by rparodi #+# #+# */
|
||||
/* Updated: 2024/03/06 12:15:50 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "../includes/push_swap.h"
|
||||
|
||||
t_list *ft_lstlast(t_list *head)
|
||||
{
|
||||
t_list *tmp;
|
||||
|
||||
tmp = head;
|
||||
while (tmp->next)
|
||||
{
|
||||
tmp = tmp->next;
|
||||
if (tmp->next == NULL)
|
||||
return (tmp);
|
||||
}
|
||||
return (tmp);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue