There is a brief introduction to both functions:
If a programmer want to allocate a block of memories, they must require the permission of OS then have it allocated in memory.
So far, two types of allocate memory are static and dynamic allocation respectively.
dynamic allocation by malloc() and calloc() has different advantages as static allocation:
- specify the length of the memory allocated
- free the allocated resource readily.