42/d11/ex00/ft_create_elem.c

28 lines
1.1 KiB
C
Raw Permalink Normal View History

2016-11-20 02:20:23 +02:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_create_elem.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/08 14:02:25 by gtertysh #+# #+# */
/* Updated: 2016/11/09 18:35:30 by gtertysh ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
#include "ft_list.h"
t_list *ft_create_elem(void *data)
{
t_list *new;
new = NULL;
if ((new = malloc(sizeof(t_list))))
{
new->data = data;
new->next = NULL;
}
return (new);
}