Liste des Groupes | Revenir à cl c |
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:An operating system might refuse to open an already opened file.bart <bc@freeuk.com> writes:I was thinking of using __FILE__ to access the source file at run time.
[...]I assume you can use __FILE__ with #embed? (I can do that with myYes, but not reliably.
version of it).
__FILE__ expands to "The presumed name of the current source file (a
character string literal)". That's rather vague.
With gcc and clang, it expands to the file name argument given to the
compiler, or to the argument of the #include directive. The running
program may or may not be able to access the source file using that
name. The source file might not even exist when the program runs.
#embed is of course handled at compile time. It's very likely, but
still not quite guaranteed, that `#embed __FILE__` will be able to
access the source file.
Les messages affichés proviennent d'usenet.