-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstadd_back_bonus.c
More file actions
29 lines (25 loc) · 1.13 KB
/
Copy pathft_lstadd_back_bonus.c
File metadata and controls
29 lines (25 loc) · 1.13 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstadd_back_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bnidia <bnidia@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/17 14:43:03 by bnidia #+# #+# */
/* Updated: 2021/10/25 19:47:33 by bnidia ### ########.fr */
/* */
/* ************************************************************************** */
/* ft_lstadd_back
** Adds the element ’new’ at the end of the list
**
*/
#include "libft.h"
void ft_lstadd_back(t_list **lst, t_list *new)
{
t_list *last_elem;
last_elem = ft_lstlast(*lst);
if (last_elem)
last_elem->next = new;
else
*lst = new;
}