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.

Comments (0)

No comments yet. Be the first to comment!

Want to practice more?

Explore thousands of MCQs across every exam category on Exams Nepal.

Find More MCQs