“Life-time” of a string literal in C
Yes, the lifetime of a local variable is within the scope({,}) in which it is created. Local variables have automatic or local storage. Automatic because they are automatically destroyed once the scope within which they are created ends. However, What you have here is a string literal, which is allocated in an implementation-defined read-only memory. … Read more