-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_lstnew_bonus.c
32 lines (29 loc) · 1.17 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: kyungkim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/28 11:26:01 by kyungkim #+# #+# */
/* Updated: 2024/11/28 12:39:39 by kyungkim ### ########.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);
}
/*
int main(void)
{
t_list *test = ft_lstnew("hi");
printf("%p %s",test,(char *)test->content);
}
*/