calloc() is another memory allocation function that is used for allocating memory at runtime . calloc function is normally used for allocating memory to derived data types such as arrays and structures. If it fails to allocate enough space as specified, it returns a NULL pointer.