feat: added lst structure
This commit is contained in:
parent
f3377656e4
commit
3287cd402f
6 changed files with 93 additions and 0 deletions
14
srcs/lst/ft_lstnew.c
Normal file
14
srcs/lst/ft_lstnew.c
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#include "libft.h"
|
||||
|
||||
t_list *ft_lstnew(void *data)
|
||||
{
|
||||
t_list *node = (t_list *)malloc(sizeof(t_list));
|
||||
|
||||
if (!node)
|
||||
return (NULL);
|
||||
|
||||
node->data = data;
|
||||
node->next = NULL;
|
||||
|
||||
return node;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue