What is dynamic memory allocation in C++?
20 views
- Allocating memory at compile-time.
- Allocating memory at run-time. (Correct Answer)
- Allocating memory on the heap.
- All of the above.
Explanation
Correct answer: b) Allocating memory at run-time.
Explanation: Dynamic memory allocation in C++ is the process of allocating memory for variables or objects at run-time, rather than at compile-time. This is done using the new operator, and the memory is allocated on the heap.