Question Detail

COS 102 test topic Objective Question

Question

What distinguishes static variable allocation from dynamic memory allocation?
Options
A Static allocation occurs at compile time; dynamic allocation occurs at runtime
Correct Answer
B Static allocation occurs on the heap; dynamic occurs on the stack
C Static memory can be resized at runtime
D Dynamic memory allocation does not require explicit pointers
Correct Answer

Option A is the correct answer.

Detailed Explanation

Static allocation fixes storage requirements before program execution, whereas dynamic allocation requests heap storage during runtime.

Hint

No hint available

Question Info