/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lstnew_bonus.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: kcolin +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/21 11:19:42 by kcolin #+# #+# */ /* Updated: 2024/10/21 11:25:46 by kcolin ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" #include t_list *ft_lstnew(void *content) { t_list *out; out = malloc(sizeof(t_list)); if (out == NULL) return (NULL); out->content = content; out->next = NULL; return (out); } /* #include int main(void) { t_list *list; list = ft_lstnew("Hello There!"); printf("content:\t%s\n", (char *)list->content); printf("next:\t%p\n", list->next); free(list); return (0); } */