GATE 2026 CS (CS2) – Question 17
In the C runtime environment, which one of the following is stored in the heap?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (C) A dynamically allocated array of integers created using `malloc()`
Explanation
Memory obtained through `malloc()` is allocated from the heap. In contrast, static variables are stored in the data segment, local arrays are usually stored on the stack, and return addresses are also stored on the stack. Therefore, option (C) is correct.