-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_lstnew_bonus.c
More file actions
38 lines (33 loc) · 1.26 KB
/
ft_lstnew_bonus.c
File metadata and controls
38 lines (33 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
35
36
37
38
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lcosta-g <lcosta-g@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/09 13:18:20 by lcosta-g #+# #+# */
/* Updated: 2024/10/26 13:31:26 by lcosta-g ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstnew(void *content)
{
t_list *node;
node = (t_list *)malloc(sizeof(t_list));
if (!node)
return (NULL);
node->content = content;
node->next = NULL;
return (node);
}
/*
#include <stdio.h>
int main(void)
{
t_list node;
node = *ft_lstnew("ft_lstnew example");
printf("Content: %s\n", (char *)node.content);
printf("Next: %p\n", node.next);
return (0);
}
*/