malloc allocates memory on the heap and returns a pointer of type void *, but there may be previous useless data in the requested space that requires memset O (1)
Calloc allocates memory on the heap, which is basically the same as malloc, but then clears the applied memory space, which is equivalent to malloc + memset, O (n)
realloc is equivalent to reallocating memory, moving the previous data to new memory.
Generally, it is malloc + memset when used, and it has good readability