How does malloc allocate space?

To dynamically allocate space, use calls to malloc passing in the total number of bytes to allocate (always use the sizeof to get the size of a specific type). A single call to malloc allocates a contiguous chunk of heap space of the passed size.
For More Information Please Refer:
https://www.cs.swarthmore.edu/~newhall/unixhelp/C_arrays.html
You May Also Like to Read: