How To Use Malloc() And Free() Functions In C/C++

malloc() function is a Dynamic Memory Allocation function that allocates a block of size bytes from the memory heap. It allows a program to allocate ...

author avatar

0 Followers

malloc() function is a Dynamic Memory Allocation function that allocates a block of size bytes from the memory heap. It allows a program to allocate memory explicitly as it is needed, and in the exact amounts needed. The allocation is from the main memory. The heap is used for dynamic C allocation of variable-sized blocks of memory. Many data structures, for example, trees and lists, naturally employ heap memory allocation.

0

Top
Comments (0)
Login to post.