Is a string literal in c++ created in static memory and destroyed only when the program exits?
Well ... Yes. They sort of have to be; the information that makes up the sequence of characters in each string has to be somewhere. If they were to be allocated dynamically and then initialized, where would the information used to to the initialization reside? Thus, it's more efficient to simply make the strings static, so that they are always available and valid once the program is done loading.