-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_taballoc.c
32 lines (29 loc) · 1.18 KB
/
ft_taballoc.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_taballoc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: afillion <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/12/09 16:09:07 by afillion #+# #+# */
/* Updated: 2015/12/17 17:00:11 by afillion ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
char **ft_taballoc(int n)
{
char **new;
int i;
i = 0;
if (!(new = (char**)malloc((n + 1) * sizeof(char*))))
return (NULL);
while (i < n)
{
new[i] = (char*)malloc((n + 1) * sizeof(char));
ft_memset(new[i], '.', n);
new[i][n] = '\0';
i++;
}
new[i] = NULL;
return (new);
}