The standard does not require that the character arrays corresponding
to identical string literals must share the same memory. The standard
is, in fact, written with the attitude that the corresponding
character arrays are naturally distinct objects, but it warns the
reader that they allowed to be the same, as an optimization. This is,
however, a very popular optimization.
Relevant clauses inculde 6.4.5p6: "It is unspecified whether these
arrays are distinct ..." and 188.8.131.52p8: "String literals, and compound
literals with const-qualified types, need not designate distinct
Note that in some cases strings can overlap in memory, even when
they're not identical. For instance, it might be the case that
"Hello world!" + 6 == "world!"
has a value of "true".