The __FILE__ Macro


The macro is __FILE__ only, with no argument list.


The __FILE__ macro expands differently depending on where it is used. Generally speaking, it expands to a string constant whose value represents the compilation unit (source file, header file, etc) that provided whatever line originated the macro invocation.

The string constant is ordinarily the name of the compilation unit, as given to the compiler (for a source file) or found by the compiler (e.g., for a header file). If the /FC option is active, the name is instead a full pathname in lower case.

Note however that if the /Brepro option is active, the __FILE__ macro expands always to