Is the following valid?
Code:const char* someFunction( void ) { return "some string"; }
Isn't the string created on the stack, and thus evaporates when the function exits, and thus the pointer is invalid? Wouldn't it be wrong to rely on it being created in some theoretcical "read only" space where it has functionally static time scope?




Reply With Quote