Difficulty: Easy
Correct Answer: Error in fclose()
Explanation:
Introduction / Context:Knowing the exact function signatures in the C standard library prevents subtle API misuse. The fclose function is designed to close a single stream at a time. Passing multiple arguments violates its prototype and leads to a compile-time error, which is important when managing several files in one function.
Given Data / Assumptions:
Concept / Approach:
Step-by-Step Solution:
Compare the call fclose(fp, fs, ft) with the prototype fclose(FILE*).Since three arguments are supplied instead of one, this is a mismatched call.Therefore, the result is a compile-time error, not the closing of any files.Verification / Alternative check:
Correct usage should be: fclose(fp); fclose(fs); fclose(ft); Each call closes a single stream and returns 0 on success.Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
Error in fclose()
Discussion & Comments