1.

Which of the following header files must necessarily be included to use dynamic memory allocation functions?(a) stdlib.h(b) stdio.h(c) memory.h(d) dos.hI had been asked this question in an online interview.The origin of the question is Static vs Dynamic Memory Allocation topic in portion Dynamic Memory Allocation in C of C

Answer» CORRECT answer is (a) stdlib.h

Easiest explanation - stdlib.h is a header FILE which stands for the standard library. It consists of the declaration for dynamic memory allocation functions such as MALLOC(), CALLOC(), realloc() and free.


Discussion

No Comment Found

Related InterviewSolutions