calloc c code example
Example 1: c calloc
// The Malloc way
void *ptr = malloc(sizeof(Type) * n_elem);
// The Calloc way
void *ptr = calloc(n_elem, sizeof(Type));
Example 2: c malloc array
#define ARR_LENGTH 2097152
int *arr = malloc (ARR_LENGTH * sizeof *arr);
Example 3: calloc
void *calloc(size_t nitems, size_t size)