Check out example codes for "c calloc". It will help you in understanding the concepts better.

Code Example 1

ptr = (castType*)calloc(n, size);

Code Example 2

void *calloc(size_t nitems, size_t size)

Learn ReactJs, React Native from akashmittal.com