GATE 2010 CS (CS1) – Question 24
Which languages necessarily need heap allocation in their runtime environment?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) Those allowing dynamic data structures
Explanation
Dynamic data structures can have sizes and lifetimes determined at runtime and can outlive individual procedure activations, requiring general heap allocation. Recursion can use an ordinary call stack; globals can use static storage. Thus C is the intended necessary heap-use feature.