C++/calloc and malloc
Difference between calloc and malloc
What happened if memory is allotted using new and freed using delete
Alloted using calloc and freed using delete
malloc allocates memory blocks and returns a void pointer to the allocated space, or NULL if there is insufficient memory available.
calloc allocates an array in memory with elements initialized to 0 and returns a pointer to the allocated space. calloc calls malloc in order to use the C++ _set_new_mode function to set the new handler mode.
malloc and free are C style and new and delete are C++ style. You should not mix them, as you will possibly get run-time error, because they use different memory management. So using new and delete is alright, but using calloc and delete is not.