From 3349e8a37a9fdf78b82d6df1d310e39c78fcebb2 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 20 Apr 2020 18:46:17 +0200 Subject: Trying linked lists --- src/ft_s_lcom.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/ft_s_lcom.c (limited to 'src/ft_s_lcom.c') diff --git a/src/ft_s_lcom.c b/src/ft_s_lcom.c new file mode 100644 index 0000000..9189113 --- /dev/null +++ b/src/ft_s_lcom.c @@ -0,0 +1,23 @@ +#include +#include +#include "ft_s_struct.h" + +t_lcom + *ft_lcom_lstnew(const char word[]) +{ + t_lcom nlcom; + char **words + + /* if (!(nlcom = (t_lcom*)malloc(sizeof(t_lcom)))) */ + /* { */ + /* return (NULL); */ + /* } */ + if (!(words = ft_split(word, ' '))) + { + return (NULL); + } + nlcom.com = words[0]; + nlcom.args = words + 1; + nlcom.next = NULL; + return (&nlcom); +} -- cgit v1.2.3