-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_calloc.c
28 lines (24 loc) · 1.27 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
26
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_calloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ssandova <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/02 18:27:50 by ssandova #+# #+# */
/* Updated: 2023/10/07 13:06:07 by ssandova ### ########.fr */
/* */
/* ************************************************************************** */
/*The calloc() function contiguously allocates enough space for count objects
that are size bytes of memory each and returns a pointer to the allocated memory.
The allocated memory is filled with bytes of value zero.*/
#include "libft.h"
void *ft_calloc(size_t count, size_t size)
{
void *pun;
pun = malloc(size * count);
if (pun == 0)
return (0);
ft_bzero(pun, count * size);
return (pun);
}