__FILE__
__FILE__ is a predefined C macro that expands to a string literal naming the current source file.
Modern C, Third Edition
__FILE__ is a predefined C macro that expands to a string literal naming the current source file.
- How it is used
- Supports debugging traces by identifying the source file associated with diagnostic output.
- How deep it goes
- Defines its string-literal expansion and debugging role, but does not develop its implementation mechanics.
- Examples
- Uses macro-based trace output that reports source location alongside debugging values.
- What you can do after
- Diagnose/debug with it by adding the originating source-file name to tracing or diagnostic output.
Modern C
__FILE__ is a predefined C macro that expands to a string literal containing the name of the current source file.
Related concepts
- macrokind of · A macro is a named, reusable construct that expands into generated code or a sequence of commands when invoked, often during preprocessing, compilation, or application execution.
- opaque typekind of · An opaque type is a type whose representation and implementation details are hidden from code outside its defining abstraction boundary.
- threaduses · A thread is a distinct sequence of execution with its own control flow and state, managed or scheduled by a processor, runtime, or operating system.
Questions about __FILE__
What is __FILE__?
__FILE__ is a predefined C macro that expands to a string literal naming the current source file.
Which Manning books explain __FILE__?
Modern C, Third Edition and Modern C.
What is __FILE__ a kind of?
__FILE__ is a kind of macro. A macro is a named, reusable construct that expands into generated code or a sequence of commands when invoked, often during preprocessing, compilation, or application execution.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

