aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Language
  • f = fopen( filename, "r" ); Referring to the code above, ...
Multiple choice

f = fopen( filename, "r" ); Referring to the code above, what is the proper definition for the variable f?

  1. FILE f

  2. FILE *f

  3. int f

  4. struct FILE f

  5. char *f

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The fopen function returns a pointer to a FILE structure, which is used to manage the file stream. Therefore, the variable f must be declared as FILE *f.

Keep practicing — related questions

  • What is the use of function feof ( ) in C language?
  • Which of the following functions accepts file pointer, as a parameter and returns either a non zero integer...
  • Code: FILE *f = fopen( fileName, "r" ); readData( f ); if( ???? ) { puts( "End of file was reached" ); } Wh...
  • Where is the file pointer fp pointing to after below mentioned statement? fseek(fp, 49, sizeof (Variable ty...
  • FILE *f = fopen( fileName, "r" ); readData( f ); if( ???? ) { puts( "End of file was reached" ); } Which on...
  • Which of the following functions accepts file pointer as a parameter and resets the position of the file po...
  • Which of the following structure declarations and structure variable's syntax is correct?
  • The scope of a global variable which is declared as __________ is within the file.
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy