Search code examples
cfiletypesiocomplex-data-types

What is datatype of FILE?


What is the data type of FILE in C or in other language?

Is it an integer or structure or having no particular data type?


Solution

  • It is what is typically termed an opaque data type, meaning it's typically declared as a simple structure, and then internally in the OS libraries the FILE pointer is cast to the actual date-type of the data-structure that the OS will use access data from a file. A lot of these details are system-specific though, so depending on the OS, the definition may differ.