Archived
1
0
This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
libft/ft_lstnew.c

26 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/11 15:30:32 by adjoly #+# #+# */
/* Updated: 2023/11/11 15:51:49 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstnew(void *content)
{
t_list *lst;
lst = malloc(sizeof(t_list));
if (lst == NULL)
return (NULL);
lst[0].content = content;
lst[0].next = NULL;
return (lst);
}