In C language, FILE is of which data type?
a) int
b) char
c) struct
d) union
Answer:
c) struct
Explanation:
In C, FILE
is a data type defined as a structure in the standard input-output library (stdio.h
). It is used to represent and manage files within a program. The FILE
structure contains information about the file, such as its location, current position in the file, and status. Functions like fopen()
, fclose()
, fread()
, and fwrite()
use pointers to FILE
to perform file operations.
Understanding the FILE
data type is essential for effective file handling in C programming.