Difficulty: Easy
Correct Answer: The handle associated with "DUMMY.C" file
Explanation:
Introduction / Context:Standard I/O in C provides buffered FILE* streams, while lower-level system calls use integer file descriptors (often called handles on some platforms). The fileno function bridges these layers by retrieving the underlying descriptor from a FILE* stream, which can be useful for system-level operations.
Given Data / Assumptions:
Concept / Approach:
Step-by-Step Solution:
Call fopen → receive a valid FILE (fp).Call fileno(fp) → get integer descriptor tied to fp.Assign to t → t now holds the OS file handle/file descriptor number.Verification / Alternative check:
Printing t typically shows small integers (e.g., 3, 4, 5) corresponding to descriptors opened by the process.Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
The handle associated with "DUMMY.C" file
Discussion & Comments