Difficulty: Easy
Correct Answer: A structure which contains a char pointer which points to the first character of a file.
Explanation:
Introduction / Context:Many beginners think a FILE points directly to file contents. In reality, FILE is an opaque structure managed by the C runtime that holds buffering state, an internal position indicator, and an association with an underlying file descriptor. Understanding this distinction helps avoid misconceptions about pointer arithmetic on FILE* and clarifies how stdio buffering works.
Given Data / Assumptions:
Concept / Approach:
Step-by-Step Explanation:
Call fopen("trial","r") → runtime allocates/initializes a FILE object.fp holds the address of that FILE object in memory.The FILE object manages buffered access to file data via getc/putc, fread/fwrite, etc.Verification / Alternative check:
Trying to dereference fp as if it were a char* is a type error; only stdio functions should use it.Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
A structure which contains a char pointer which points to the first character of a file.
Discussion & Comments