Which one of the following is correct syntax for opening a file.

Category: QuestionsWhich one of the following is correct syntax for opening a file.
Editor">Editor Staff asked 11 months ago

Which one of the following is correct syntax for opening  a file.
 
(a) FILE *fopen(const *filename, const char *mode)
 
(b) FILE *fopen(const *filename)
 
(c) FILE *open(const *filename, const char *mode)
 
(d) FILE open(const*filename)
 
The question was asked in final exam.
 
My question is based upon File Operations in section Input and Output in C of C
NCERT Solutions for Subject Computer science (C Programming) Select the correct answer from above options 
Interview Questions and Answers, Database Interview Questions and Answers for Freshers and Experience

1 Answers
Editor">Editor Staff answered 11 months ago

Correct choice is (a) FILE *fopen(const *filename, const char *mode)
 
Explanation: fopen() opens the named file, and returns a stream, or NULL of the attempt fails.