Libft aortigos
This commit is contained in:
26
ft_calloc.c
Normal file
26
ft_calloc.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_calloc.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: aortigos <aortigos@student.42malaga.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/09/24 15:16:49 by aortigos #+# #+# */
|
||||
/* Updated: 2023/09/24 15:18:05 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
void *ft_calloc(size_t count, size_t size)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
ptr = malloc(count * size);
|
||||
if (!(ptr))
|
||||
{
|
||||
return (NULL);
|
||||
}
|
||||
ft_bzero(ptr, count * size);
|
||||
return (ptr);
|
||||
}
|
||||
Reference in New Issue
Block a user