Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

C | File Handling | Question 2

  • Last Updated : 28 Jun, 2021

When fopen() is not able to open a file, it returns
(A) EOF
(B) NULL
(C) Runtime Error
(D) Compiler Dependent


Answer: (B)

Explanation: fopen() returns NULL if it is not able to open the given file due to any of the reasons like file not present, inappropriate permissions, etc.

Quiz of this Question

Take a step-up from those "Hello World" programs. Learn to implement data structures like Heap, Stacks, Linked List and many more! Check out our Data Structures in C course to start learning today.
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!