Difficulty: Easy
Correct Answer: 2, 2
Explanation:
Introduction / Context:
This item checks understanding that sizeof(pointer) depends on the platform and memory model, not on the pointed-to type. In classic 16-bit DOS small model, near pointers are 2 bytes.
Given Data / Assumptions:
Concept / Approach:
sizeof(p) yields the size of the pointer variable p itself. On 16-bit near model, this is 2 bytes regardless of p’s target type. Same applies to q.
Step-by-Step Solution:
Verification / Alternative check:
Check compiler documentation for Turbo C’s small model: near data/code pointers are 2 bytes; far are 4. Without far qualifiers here, near size applies.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing sizeof(*p) (size of struct node) with sizeof(p) (size of pointer). Also assuming modern 4- or 8-byte pointers universally.
Final Answer:
2, 2
Discussion & Comments