-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_calloc.c
25 lines (22 loc) · 1.09 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
25
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_calloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: acalin-b <[email protected] +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/18 12:04:10 by acalin-b #+# #+# */
/* Updated: 2023/03/22 10:46:45 by acalin-b ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
void *ft_calloc(size_t n, size_t size)
{
void *elements;
elements = malloc(n * size);
if (elements == NULL)
return (NULL);
ft_bzero(elements, n * size);
return (elements);
}