1.

A condition where in memory is reserved dynamically but not accessible to any of the programs is called _____________(a) Memory leak(b) Dangling pointer(c) Frozen memory(d) Pointer leakI have been asked this question in examination.I'm obligated to ask this question of DMA Functions, Memory Leak, Dangling Pointers topic in chapter Dynamic Memory Allocation in C of C

Answer»

The CORRECT option is (a) MEMORY leak

Explanation: If we allocate memory dynamically in a function (malloc, calloc, realloc), the allocated memory will not be de-allocated automatically when the control comes out of the function. This allocated memory cannot be accessed and hence cannot be used. This unused inaccessible memory RESULTS in a memory leak.



Discussion

No Comment Found

Related InterviewSolutions