tgrekov-libft
HIVE libft Oct 2023
Loading...
Searching...
No Matches
ft_calloc.c File Reference

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_calloc.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/10/25 14:33:28 by tgrekov #+# #+# */
/* Updated: 2023/11/06 19:16:56 by tgrekov ### ########.fr */
/* */
/* ************************************************************************** */

Definition in file ft_calloc.c.

#include "libft.h"
Include dependency graph for ft_calloc.c:

Go to the source code of this file.

Functions

void * ft_calloc (size_t count, size_t size)
 Allocates count * size bytes with malloc and returns a pointer to the result.
 

Function Documentation

◆ ft_calloc()

void * ft_calloc ( size_t  count,
size_t  size 
)

Allocates count * size bytes with malloc and returns a pointer to the result.

Parameters
[in]countNumber of objects to allocate for
[in]sizeSize of each object
Return values
void*Freeable pointer to allocated memory after it is filled with zeroes
If either count or size are 0, returns ft_calloc(1, 1).
If the multiplication of count and size overflows, returns NULL.

Definition at line 34 of file ft_calloc.c.

References ft_bzero(), and ft_calloc().

Here is the call graph for this function:
Here is the caller graph for this function: