what is dynamic memory??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is dynamic memory???

17th Oct 2016, 4:02 PM
frizern
frizern - avatar
2 Answers
+ 3
It's memory allocated at run time, on the heap. Use new to create an object dynamically, and delete to free the memory. Example: int *ans = new int(42); cout << *ans << endl; delete ans;
17th Oct 2016, 5:23 PM
Zen
Zen - avatar
+ 1
the memory used while program is running called as dynamic memory
17th Oct 2016, 5:22 PM
Mohd Osman Ansari
Mohd Osman Ansari - avatar