All mock tests are FREE till 31 December — register to save your progress

Arrange the following steps of file handling in C in the correct order:
(A) Close the file
(B) Read from or write to the file
(C) Open the file
(D) Check for error
Choose the correct answer from the options given below:

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. (C), (D), (B), (A)

Explanation

fopen the file, check that the returned pointer is not NULL, read/write, then fclose.

More Programming Languages and Computer Graphics questions