-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstadd_back.c
More file actions
32 lines (29 loc) · 1.1 KB
/
ft_lstadd_back.c
File metadata and controls
32 lines (29 loc) · 1.1 KB
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
30
31
32
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_lstadd_back.c :+: :+: */
/* +:+ */
/* By: farodrig <farodrig@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2020/12/13 20:48:32 by farodrig #+# #+# */
/* Updated: 2020/12/13 21:00:19 by farodrig ######## odam.nl */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** Adds the element 'new' at the end of the list.
*/
void ft_lstadd_back(t_list **list, t_list *new)
{
if (list)
{
if (*list)
{
ft_lstlast(*list)->next = new;
}
else
{
*list = new;
}
}
}