Storage of String Literals

The characters of a literal string are stored in order at contiguous memory locations. An escape sequence (such as \\ or \") within a string literal counts as a single character. A null character (represented by the \0 escape sequence) is automatically appended to, and marks the end of, each string literal. (This occurs during translation phase 7. Note that the compiler may not store two identical strings at two different addresses. The /Gf (Eliminate Duplicate Strings) compiler option forces the compiler to place a single copy of identical strings into the executable file.

Microsoft Specific —>

Strings have static storage duration. See Storage Classes in Chapter 3 for information about storage duration.

END Microsoft Specific