-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstnew_bonus.c
34 lines (30 loc) · 1.3 KB
/
ft_lstnew_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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: anamart3 <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/19 15:40:38 by anamartinez #+# #+# */
/* Updated: 2023/04/26 19:47:52 by anamart3 ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstnew(void *content)
{
t_list *new_node;
new_node = (t_list *) malloc(sizeof(t_list));
if (new_node == NULL)
return (NULL);
new_node->content = content;
new_node->next = NULL;
return (new_node);
}
// int main(void)
// {
// char *str = "Soy un nodo";
// t_list *new_node = ft_lstnew(str);
// if (new_node != NULL)
// printf("Node content: %s", (char *)new_node->content);
// return (0);
// }