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
15t_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}
t_list * ft_lstnew(void *content)
Create a new node.
Definition ft_lstnew.c:15
Definition libft.h:22
void * content
Definition libft.h:23
struct s_list * next
Definition libft.h:24