-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstnew.c
More file actions
42 lines (33 loc) · 1.32 KB
/
Copy pathft_lstnew.c
File metadata and controls
42 lines (33 loc) · 1.32 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aantonie <aantonie@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/30 01:06:21 by aantonie #+# #+# */
/* Updated: 2023/12/04 15:08:06 by aantonie ### ########.fr */
/* */
/* ************************************************************************** */
// READY
#include "libft.h"
t_list *ft_lstnew(void *content)
{
t_list *node;
node = malloc(sizeof(t_list));
if (node == NULL)
return (NULL);
node->content = content;
node->next = NULL;
return (node);
}
// int main(void)
// {
// t_list Antoan;
// t_list jOHN;
// jOHN.content = (void *)77;
// jOHN.next = &Antoan;
// Antoan.content = (void *)45;
// printf("%d %p",(int)Antoan.content, jOHN.next);
// return (0);
// }