Asked by Olumide Adesiyan
Explain the term "dynamic memory allocation" in C++?
Please explain it in such a way i will understand it
Please explain it in such a way i will understand it
Answers
Answered by
Steve
when your program loads and runs, it occupies a certain amount of memory, for instructions, data storage, etc. As it runs, it may need additional memory space to store more data, or load new instructions.
So, one of the system subroutines is a call to malloc or some equivalent function, which contacts the operating system and requests a new chunk of memory for program use.
This is dynamic allocation, as opposed to the static amount allocated when the program started.
It's not unique to C++. Any modern programming language has some way to grab more memory as it is needed.
So, one of the system subroutines is a call to malloc or some equivalent function, which contacts the operating system and requests a new chunk of memory for program use.
This is dynamic allocation, as opposed to the static amount allocated when the program started.
It's not unique to C++. Any modern programming language has some way to grab more memory as it is needed.
Answered by
Olumide Adesiyan
Thank you so much
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.