-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstadd_front_bonus.c
36 lines (30 loc) · 1.21 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstadd_front_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rhiguita <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/12 12:52:15 by rhiguita #+# #+# */
/* Updated: 2024/05/12 18:37:43 by rhiguita ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void ft_lstadd_front(t_list **lst, t_list *new)
{
if (lst)
{
if (*lst)
new->next = *lst;
*lst = new;
}
}
/*
int main(void)
{
t_list *node1 = ft_lstnew("Nodo existente");
t_list *node2 = ft_lstnew("Nuevo nodo");
ft_lstadd_front(&node1, node2);
printf("contenido: %s\n", (char *)(node2->content));
return (0);
}*/