tgrekov-libft
HIVE libft Oct 2023
Loading...
Searching...
No Matches
ft_lstnew_bonus.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_lstnew_bonus.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2023/10/28 00:27:48 by tgrekov #+# #+# */
9
/* Updated: 2023/11/09 20:53:15 by tgrekov ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
20
#include "
libft.h
"
21
29
t_list
*
ft_lstnew
(
void
*content)
30
{
31
t_list
*node;
32
33
node = malloc(
sizeof
(
t_list
));
34
if
(!node)
35
return
(0);
36
node->
content
= content;
37
node->
next
= 0;
38
return
(node);
39
}
ft_lstnew
t_list * ft_lstnew(void *content)
Allocates a new node, set it's content, and return it's address.
Definition
ft_lstnew_bonus.c:29
libft.h
s_list
Linked list node.
Definition
libft.h:44
s_list::next
struct s_list * next
Pointer to the next node.
Definition
libft.h:46
s_list::content
void * content
void* to the node's contents.
Definition
libft.h:45
ft_lstnew_bonus.c