- Static Memory allocation
- In case of static memory allocation, memory is allocated at compile time and memory can’t be increased while executing the program. It is used in array
- Dynamic memory allocation
- In case of dynamic memory allocation, memory is allocated at run time and memory can be increased while executing the program. It is used in linked list.
- The following functions are used in Dynamic memory allocation
malloc() – allocates single block of requested memory. It has garbage value initially.
calloc() – allocates multiple block of requested memory. It initially initializes all bytes to zero.
realloc() – reallocates the memory occupied by
free() – frees the dynamically allocated memory.
Difference b/w Static and dynamic memory allocation?
if you have any queries call us +918300026060 or WhatsApp Dismiss