Files
42_INT_01_libft/srcs/ft_calloc.c
2019-11-19 18:16:42 +01:00

29 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_calloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/11/19 14:56:09 by hulamy #+# #+# */
/* Updated: 2019/11/19 15:21:25 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
/*
** exemple allocation for 5 integers with malloc then calloc :
** a = (int *)malloc(5 * sizeof(int)); //5*4bytes = 20 bytes
** free(a);
** a = (int *)calloc(5, sizeof(int));
**
** allocate count * size byte of memory and
** return a pointer to the allocated memory
*/
#include "libft.h"
void *ft_calloc(size_t count, size_t size)
{
return (ft_memalloc(count * size));
}