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
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. (C), (D), (B), (A)
Explanation
Open the file (fopen), check it opened without error (NULL check), read or write, then close it (fclose).
More Programming Languages and Computer Graphics questions
- #include<stdio.h> void main() { int arr[ ] = {1, 2, 3, 4, 5}; int *p = arr; printf("%d", *p++); printf("%d", *(p+1)); } Find the output of…
- Which of the following is not an object Oriented Programming language ?
- Multiple Inheritance is permitted directly in..... A. C++ B. Java C. Python D. VB.NET E. BASIC
- Match List-I with List-II :
- For line drawing, which of the following algorithms are used ? A. DDA algorithm B. Bresenham algorithm C. Mid point algorithm D. Curve algo…
- The least values of a signed and unsigned data type variables requiring 8 bits, would be...