-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstadd.c
29 lines (26 loc) · 1.16 KB
/
ft_lstadd.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_lstadd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yinzhang <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/19 12:20:02 by yinzhang #+# #+# */
/* Updated: 2019/03/27 09:43:58 by yinzhang ### ########.fr */
/* */
/* ************************************************************************** */
/*
** this adds another link to the list
** new is passed in as a variable
** the next link to it is set as the address of alst
** so it adds it in fornot of it
*/
#include "libft.h"
void ft_lstadd(t_list **alst, t_list *new)
{
if (new != NULL)
{
new->next = *alst;
*alst = new;
}
}