1.

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 programI have been asked this question during an online exam.This question is from Static vs Dynamic Memory Allocation in section Dynamic Memory Allocation in C of C

Answer»

The correct answer is (c) Execution of the PROGRAM is faster than that of STATIC memory ALLOCATION

The best I can explain: Execution of the program USING dynamic memory allocation is slower than that using static memory allocation. This is because in dynamic memory allocation, the memory has to be allocated during run time. This slows down the execution of the program.



Discussion

No Comment Found

Related InterviewSolutions