Machine-translated by Google. Questions are authored in English.
Top

Discussion

Choose the statement which is incorrect with respect to dynamic memory allocation.

  • A.Memory is allocated in a less structured area of memory, known as heap
  • B.Used for unpredictable memory requirements
  • C.Execution of the program is faster than that of static memory allocation
  • D.Allocated memory can be changed during the run time of the program based on the requirement of the program

Answer: C

Correct answer: Execution of the program is faster than that of static memory allocation

This is the incorrect statement. Dynamic allocation is slower, not faster: each request involves a run-time search of the heap for a suitable block, and freeing returns it for reuse, all of which costs time that a statically allocated object does not incur. The other three are correct - the heap is less structured, it suits unpredictable requirements, and the allocation can change as the program runs.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.