COMPILER DESIGN

TOOLS AND TECHNIQUES FOR COMPILER DESIGN

MISCELLENOUS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The languages that need heap allocation in the runtime environment are
A
Those that use global variables
B
Those that use dynamic scoping
C
Those that support recursion
D
Those that allow dynamic data structure
Explanation: 

Detailed explanation-1: -C) Dynamic data structures have the property that the size is known only at runtime and this needs the heap. Hence the correct answer is Those that allow dynamic data structures.

Detailed explanation-2: -Heap allocation is the most flexible allocation scheme. Allocation and deallocation of memory can be done at any time and any place depending upon the user’s requirement. Heap allocation is used to allocate memory to the variables dynamically and when the variables are no more used then claim it back.

There is 1 question to complete.