J
Johan Lindh
This is somewhat obscure, and I'm not sure if the question is valid in
comp.lang.c. If it isn't, please ignore it.
In a C program, the pointer resulting from a __FILE__ is stored.
The pointer refers to a normal string constant (I think).
Does the standard say anything about when that constant is destroyed,
thus rendering any use of the stored pointer undefined behavior?
I guess the question might be simplified into:
"What's the lifetime of a string constant?"
My gut reaction is of course "Until the program ends".
Regards,
Johan
comp.lang.c. If it isn't, please ignore it.
In a C program, the pointer resulting from a __FILE__ is stored.
The pointer refers to a normal string constant (I think).
Does the standard say anything about when that constant is destroyed,
thus rendering any use of the stored pointer undefined behavior?
I guess the question might be simplified into:
"What's the lifetime of a string constant?"
My gut reaction is of course "Until the program ends".
Regards,
Johan