-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstnew.c
40 lines (34 loc) · 1.26 KB
/
ft_lstnew.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: julmuntz <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/02 15:03:05 by julmuntz #+# #+# */
/* Updated: 2022/06/02 17:16:48 by julmuntz ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
t_list *ft_lstnew(void *content)
{
t_list *var;
var = malloc(sizeof(t_list));
if (var == NULL)
return (NULL);
var->content = content;
var->next = NULL;
return (var);
}
/*
#include <stdio.h>
int main(int arc, char **arv)
{
t_list *str;
if (arc == 2)
{
str = ft_lstnew(arv[1]);
printf("%s\n", (char *)str->content);
}
}
*/