+ 2
What is dynamic memory?
5 Answers
+ 8
Memory needs are usually determined before program execution, but there are cases where they can only be determined at runtime. There are also cases where you want the memory allocation to persist across multiple function calls. On these cases, programs need to dynamically allocate memory, which in C++ is done with the operators new and delete.
Dynamic memory allocation is done on the heap (rather than the stack like static memory allocation).
Don't forget to properly delete anything you created dynamically, or you will end up clogging the ram little by little with each execution of your program until you reboot (this is called a memory leak).
+ 1
Thanks zen
+ 1
in short... memory area allocated at run time are dynamic memory......
+ 1
if the array size is not fix then we can use dynamic memory.
using new operatpr
0
@zen should the delete function be called at the end of every program to clr the dynamic memory n is it a function i.e. delete