42sh 1.0.0
Create a shell in C
Loading...
Searching...
No Matches
my_calloc.c File Reference

The file containing the my_calloc function. More...

#include "mymemory.h"

Functions

void * my_calloc (size_t element_count, size_t element_size, int type)
 Allocates memory for an array of elements (element_count) of bytes (element_size) each and initializes the memory to zero.
 

Detailed Description

The file containing the my_calloc function.

Author
Nicolas TORO

Function Documentation

◆ my_calloc()

void * my_calloc ( size_t element_count,
size_t element_size,
int type )

Allocates memory for an array of elements (element_count) of bytes (element_size) each and initializes the memory to zero.

Note
type = 0: Free allocated memory with my_calloc
type = 1: Allocate memory
Parameters
element_countThe number of elements
element_sizeThe size of each element
typeThe type of the usage
Returns
void * A pointer to the allocated memory
Author
Nicolas TORO