-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstadd_front_bonus.c
More file actions
34 lines (30 loc) · 1.26 KB
/
ft_lstadd_front_bonus.c
File metadata and controls
34 lines (30 loc) · 1.26 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstadd_front_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mjusta <mjusta@student.42prague.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/28 16:09:24 by mjusta #+# #+# */
/* Updated: 2025/05/28 17:57:42 by mjusta ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.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 *node1 = ft_lstnew("first");
t_list *node2 = ft_lstnew("second");
ft_lstadd_front(&node1, node2);
printf("%s -> %s\n", (char *)node1->content, (char *)node1->next->content);
free(node1->next);
free(node1);
}*/