Professional Documents
Culture Documents
1 C Programming Memory Allocation Download PDF
1 C Programming Memory Allocation Download PDF
com
http://www.gkseries.com/computer-engineering/c-programming/memory-allocation/c-programmng-interview-questions-and-answers-
1
1.
With every use of memory allocation function, what function should be used to release allocated memory which is
no longer needed?
[A] dropmem()
[B] dealloc()
[C] release()
[D] free()
The library function free() is used to deallocate the memory that is no longer be used. This deallocated memory is
dynamically allocated by malloc, calloc and realloc previously.
2.
Physically placing the machine instructions and data into main memory is done by
[A] Linker
[B] Loader
[D] Interpreter
3.
Which header file should be included to use function like malloc() and calloc()?
[A] memory.h
[B] stdlib.h
[C] string.h
[D] dos.h
Answer & Explanation
The stdlib.h header file contains malloc(), calloc() and realloc() dynamically allocated array functions.
4.
[A] remove(variable-name);
[B] free(variable-name);
[C] delete(variable-name);
[D] dealloc(variable-name);
5.
[A] Heap
[B] Tree
[C] Stack
[D] Queue