Mandatory finished
This commit is contained in:
28
libft/ft_lstadd_back_bonus.c
Normal file
28
libft/ft_lstadd_back_bonus.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_lstadd_back_bonus.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/09 15:06:49 by dgaillet #+# #+# */
|
||||
/* Updated: 2025/11/12 13:11:12 by dgaillet ### ########lyon.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
void ft_lstadd_back(t_list **lst, t_list *new)
|
||||
{
|
||||
t_list *temp;
|
||||
|
||||
if (!lst)
|
||||
return ;
|
||||
if (!(*lst))
|
||||
{
|
||||
*lst = new;
|
||||
return ;
|
||||
}
|
||||
temp = ft_lstlast(*lst);
|
||||
temp->next = new;
|
||||
}
|
||||
Reference in New Issue
Block a user