-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstadd_front.c
More file actions
43 lines (38 loc) · 1.34 KB
/
ft_lstadd_front.c
File metadata and controls
43 lines (38 loc) · 1.34 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
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstadd_front.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tauer <tauer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/07 23:24:39 by tauer #+# #+# */
/* Updated: 2023/11/13 13:58:54 by tauer ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
typedef struct s_list
{
void *content;
struct s_list *next;
} t_list;
*/
/* void foo(void)
{
t_list *head = ft_lstnew(info_user1);
t_list *node = ft_lstnew(info_user2);
head->next NULL
node->next NULL
-- todo --
head->next NULL
node->next head
head->next->content; seg
ft_lstadd_front(&head, node);
head(apres appel) egale a node;
head->next->content;
} */
void ft_lstadd_front(t_list **lst, t_list *new)
{
new->next = *lst;
*lst = new;
}