Question 43Asked in UGC NET Computer Science, June 2014 (Paper II & III, Selected Questions)

Match the following with respect to I/O classes in object oriented programming :

Match the following with respect to I/O classes in object oriented programming : List-I (A) fopen() (B) fclose() (C) ferror() (D) feof() List-II (i) returns end of file (ii) return for any problem report (iii) returns 0 (iv) returns a file pointer Codes : A B C D
  1. Aiv i ii iii
  2. Biii i iv ii
  3. Cii iii iv i
  4. Div iii i ii
Show answerHide answer

Correct answer: (A) iv i ii iii

Explanation

Fopen() : creates a file or opens an existing file and returns a file pointer, e.g. FILE ∗fp; fp = fopen("<file-name>", "<mode>"); fclose() : closes a file; returns 0 on success and EOF otherwise. ferror() : checks the error indicator for the given file stream, returning non-zero if set and 0 otherwise. feof() : checks the end-of-file indicator for the given file stream, returning non-zero if set and 0 otherwise.

From UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions)

This is question 43 of UGC NET Computer Science PYQ, June 2014 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.