-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathft_lstadd.c
29 lines (27 loc) · 1.06 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: oadhesiv <oadhesiv@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/18 14:20:35 by oadhesiv #+# #+# */
/* Updated: 2019/05/18 14:22:16 by oadhesiv ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstadd(t_list **alst, t_list *elem)
{
if (!alst)
{
alst = &elem;
return ;
}
if (!*alst)
{
*alst = elem;
return ;
}
elem->next = *alst;
*alst = elem;
}