-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstadd.c
39 lines (36 loc) · 1.38 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
30
31
32
33
34
35
36
37
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstadd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mbutt <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/24 15:44:29 by mbutt #+# #+# */
/* Updated: 2019/03/25 11:53:39 by mbutt ### ########.fr */
/* */
/* ************************************************************************** */
/*
** Adds the element new at the beginning of the list.
** Param#1 - The address of a pointer to the first link of a list.
** param#2 - The link to add at the beginning of the list.
** Return Value - None.
** Libc function - None.
*/
#include "libft.h"
void ft_lstadd(t_list **alst, t_list *new)
{
new->next = *alst;
*alst = new;
}
/*
** Creating an additional element
*/
/*
**void ft_lstadd(t_list **alst, t_list *new)
**{
** t_list *element;
** element = new;
** element->next = *alst;
** *alst = element;
**}
*/