Libft
42 Libft library documentation
Loading...
Searching...
No Matches
ft_lstnew.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_lstnew.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: raphalme <raphalme@student.42.fr> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2025/12/29 19:15:00 by raphalme #+# #+# */
9
/* Updated: 2026/04/14 10:45:22 by raphalme ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include <stdlib.h>
14
#include "../includes/types.h"
15
24
t_list
*
ft_lstnew
(
void
*content)
25
{
26
t_list
*new_elem;
27
28
new_elem = (
t_list
*)malloc(
sizeof
(
t_list
));
29
if
(!new_elem)
30
return
(NULL);
31
new_elem->
content
= content;
32
new_elem->
next
= NULL;
33
return
(new_elem);
34
}
ft_lstnew
t_list * ft_lstnew(void *content)
Creates a new linked-list node.
Definition
ft_lstnew.c:24
s_list
Definition
types.h:4
s_list::next
struct s_list * next
Definition
types.h:6
s_list::content
void * content
Definition
types.h:5
src
ft_lstnew.c
Generated by
1.9.8