-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_calloc.c
24 lines (21 loc) · 1.06 KB
/
ft_calloc.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_calloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mtraball <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/02/01 16:27:43 by mtraball #+# #+# */
/* Updated: 2021/04/15 13:04:38 by mtraball ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_calloc(size_t nelem, size_t elsize)
{
char *p;
p = malloc(nelem * elsize);
if (p == NULL)
return (NULL);
p = ft_memset(p, 0, nelem * elsize);
return (p);
}