-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstadd_front_bonus.c
40 lines (37 loc) · 1.32 KB
/
ft_lstadd_front_bonus.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
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstadd_front_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: acalin-b <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/25 16:08:05 by acalin-b #+# #+# */
/* Updated: 2023/03/25 16:15:47 by acalin-b ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
void ft_lstadd_front(t_list **lst, t_list *new)
{
if (!lst || !new)
return ;
new->next = *lst;
*lst = new;
}
//#include <stdio.h>
//
//int main(void)
//{
// t_list *new;
// t_list *new2;
// t_list *new3;
//
// new = ft_lstnew("Hello");
// new2 = ft_lstnew("World");
// new3 = ft_lstnew("!");
// ft_lstadd_front(&new, new2);
// ft_lstadd_front(&new, new3);
// printf("%s", new->content);
// return (0);
//}
//