-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_xy_list_create.c
executable file
·33 lines (30 loc) · 1.16 KB
/
ft_xy_list_create.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_xy_list_create.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ioleksiu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/29 21:24:08 by ioleksiu #+# #+# */
/* Updated: 2017/01/30 17:57:57 by ioleksiu ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
t_xy *ft_xy_list_create(int n)
{
t_xy *a;
t_xy *head;
t_xy *next_list;
int i;
i = 0;
a = (t_xy*)malloc(sizeof(t_xy));
head = a;
while (--n)
{
next_list = (t_xy *)malloc(sizeof(t_xy));
a->next = next_list;
a = next_list;
}
a->next = (NULL);
return (head);
}