edited by
519 views

1 Answer

1 votes
1 votes

Static Memory: It is allocated during runtime of a program, once its data type is fixed it cannot be changed, it occupies space in hard disk before runtime, when the program is running one cannot free the memory which is assigned to the variable even if it variable is not used ever. Array is a classic example of static Memory, once we declare an array of a particular size that amount of memory will be reserved and in contagious memory location and that space will be reserved throughout entire run of program 

Dynamic memory: As the name suggests it is dynamic in nature, it can be created, assigned and destroyed at any instance of time, one disadvantage of it is that it assigns random memory location each time for the new variable. At any point, memory assigned to it can be free, the memory assignment is done at runtime. A linked list is a classic example of it one can keep adding nodes in the system.

Related questions

2 votes
2 votes
2 answers
1
Dheeraj Varma asked Nov 16, 2021
1,148 views
What is answer for this question and also please explain the approach
0 votes
0 votes
0 answers
4
admin asked Oct 26, 2019
379 views
In some systems it is possible to map part of a file into memory. What restrictions must such systems impose? How is this partial mapping implemented?