__FILE__expands to a regular string literal. Therefore, while you are only reading this, you can simply use const char*as
const char *filename = __FILE__;
Since string literals have a static storage duration, the pointer will remain valid throughout the program.
- , .
, , " " .
@Keith Thompson , __FILE__ , :
const char *f1 = __FILE__;
const char *f2 = __FILE__;
assert(f1 == f2);
, , , .