Skip to content
Related Articles

Related Articles

C | File Handling | Question 1
  • Last Updated : 30 Jan, 2014

Which of the following true about FILE *fp
(A) FILE is a keyword in C for representing files and fp is a variable of FILE type.
(B) FILE is a structure and fp is a pointer to the structure of FILE type
(C) FILE is a stream
(D) FILE is a buffered stream


Answer: (B)

Explanation: fp is a pointer of FILE type and FILE is a structure that store following information about opened file.




typedef struct {
  int level; /* fill/empty level of buffer */
  unsigned flags; /* File status flags */
  char fd; /* File descriptor */
  unsigned char hold; /* Ungetc char if no buffer */
  int bsize; /* Buffer size */
  unsigned char *buffer; /* Data transfer buffer */
  unsigned char *curp; /* Current active pointer */
  unsigned istemp; /* Temporary file indicator */
  short token; /* Used for validity checking */
}FILE;



Quiz of this Question

Attention reader! Don’t stop learning now. Get hold of all the important C++ Foundation and STL concepts with the C++ Foundation and STL courses at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :