Static memory allocation
It refers to the allocation of memory during compilation of program.
Memory bindings are not established and destroyed during the execution
Variables remain permanently
allocated.
Faster execution than dynamic.
More memory space required.
Data is stored in data segment of memory.
Dynamic memory allocation
It refers to the allocation of memory during execution of program.
Memory bindings are established and destroyed during the execution.
Allocated only when program unit is active.
Slower execution than static.
Less memory space required.
Data is stored in heap memory.
Also Read
- Memory Leakes and Dangling Pointer
- Memory Allocation for 2D Array
- Dynamic Memory Allocation
- Pointer constant and constant pointer
- Some Pointer Declaration and their Meanings
- Function and pointers
- Initializing Pointer to Pointer
- Pointer to Pointer Multiple Indirection
- Relationship between Arrays and Pointers
- Pointer to Array
- Pointer Arithmetic
- Types of Pointers
- Illustrate Basic Pointer Use
- Using Pointer
- Intializing Pointer
- Declaring Pointer
- Application of Pointers
- Value Model VS Reference Model
- What is Pointer
Comments
Post a Comment
Please give us feedback through comments