-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_calloc.c
More file actions
30 lines (28 loc) · 1.23 KB
/
ft_calloc.c
File metadata and controls
30 lines (28 loc) · 1.23 KB
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
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_calloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mattig <mattig@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/25 21:02:41 by mattig #+# #+# */
/* Updated: 2021/11/07 13:01:02 by mattig ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
/*
** Calloc Alloue de la memoire pour un tableau de tant octes
** la zone est remplit de zero
** Params : Taille + Espace
** Return : Un pointeur vers ou NULL
*/
void *ft_calloc(size_t count, size_t size)
{
char *xxx;
xxx = malloc(size * count);
if (!xxx)
return (NULL);
ft_memset(xxx, 0, count * size);
return (xxx);
}