Anonymous

What's Difference Between Static And Dynamic Memory Allocation?

2

2 Answers

Anonymous Profile
Anonymous answered
In dynamic memory allocation,size of the memory allocated is not fixed whereas in static, it is fixed;
in dynamic, the memory allocated for various variables during execution time but in static,its during compilation time;
dynamic memory allocated stores its memory on heap and static memory allocation stores its data in data segment.
Anonymous Profile
Anonymous answered
Dynamic memory allocation is at run time. Static memory allocation is before run time, but the values of variables may be changed at run time.

Static memory allocation saves running time, but can't be possible in all cases.

Dynamic memory allocation stores it's memory on heap, and the static memory allocation stores it's data in the "data segment" of the memory.

Answer Question

Anonymous