__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 construct that expands or transforms source code, commands, or templates before or during 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 an independently schedulable sequence or context of execution within a program or process.
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.

