-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_nbnew.c
executable file
·27 lines (24 loc) · 1.07 KB
/
ft_nbnew.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_nbnew.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mberger <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/28 05:01:13 by mberger #+# #+# */
/* Updated: 2015/03/19 22:39:36 by mberger ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
int *ft_nbnew(int size)
{
int *nb;
if (!(nb = (int*)malloc(sizeof(int) * size)))
return ((int*)NULL);
else
{
while (size--)
nb[size] = 0;
return ((int*)nb);
}
}