Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 1.33 KB

storage-of-string-literals.md

File metadata and controls

29 lines (25 loc) · 1.33 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
Storage of String Literals | Microsoft Docs
11/04/2016
cpp-language
article
C++
string literals, storage
ba5e4d2c-d456-44b3-a8ca-354af547ac50
9
mikeblome
mblome
ghogen

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. /GF forces the compiler to place a single copy of identical strings into the executable file.

Remarks

Microsoft Specific

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

END Microsoft Specific

See Also

C String Literals