C | File Handling | Question 4
In fopen(), the open mode “wx” is sometimes preferred “w” because.
1) Use of wx is more efficient.
2) If w is used, old contents of file are erased and a new empty file is created. When wx is used, fopen() returns NULL if file already exists.
(A) Only 1
(B) Only 2
(C) Both 1 and 2
(D) Neither 1 nor 2
Answer: (B)
Explanation: See https://www.geeksforgeeks.org/fopen-for-an-existing-file-in-write-mode/
Quiz of this Question
Recommended Posts:
- C | File Handling | Question 3
- C | File Handling | Question 1
- C | File Handling | Question 2
- C | File Handling | Question 5
- Basics of File Handling in C#
- Basics of File Handling in C
- Four File Handling Hacks which every C/C++ Programmer should know
- C++ | Exception Handling | Question 1
- C++ | Exception Handling | Question 12
- C++ | Exception Handling | Question 8
- C++ | Exception Handling | Question 9
- C++ | Exception Handling | Question 5
- C++ | Exception Handling | Question 6
- C++ | Exception Handling | Question 11
- C++ | Exception Handling | Question 2



