libft
Loading...
Searching...
No Matches
ft_lstnew.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_lstnew_bonus.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: tspoof <tspoof@student.hive.fi> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2022/11/06 15:32:39 by tspoof #+# #+# */
9
/* Updated: 2022/11/16 12:55:54 by tspoof ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include "
libft.h
"
14
15
t_list
*
ft_lstnew
(
void
*content)
16
{
17
t_list
*lst;
18
19
lst = (
t_list
*)malloc(
sizeof
(
t_list
));
20
if
(!lst)
21
return
(NULL);
22
lst->
content
= content;
23
lst->
next
= NULL;
24
return
(lst);
25
}
ft_lstnew
t_list * ft_lstnew(void *content)
Create a new node.
Definition
ft_lstnew.c:15
libft.h
s_list
Definition
libft.h:22
s_list::content
void * content
Definition
libft.h:23
s_list::next
struct s_list * next
Definition
libft.h:24
src
ft_lstnew.c
Generated by
1.9.7