As I know compiletime C-like strings are kept in static memory as only one instance. For instance I got both true
on gcc 4.6 running example below. But I wonder is
No, it's implementation dependent for both C and C++.
C11 §6.4.5/7 String literals
It is unspecified whether these arrays are distinct provided their elements have the appropriate values. If the program attempts to modify such an array, the behavior is undefined.
C++11 §2.14.5/12 String literals
Whether all string literals are distinct (that is, are stored in nonoverlapping objects) is implementation-defined. The effect of attempting to modify a string literal is undefined.