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
24t_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}
t_list * ft_lstnew(void *content)
Creates a new linked-list node.
Definition ft_lstnew.c:24
Definition types.h:4
struct s_list * next
Definition types.h:6
void * content
Definition types.h:5