Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: wordsmithing

...

At compile time, string literals are used to create an array of static storage duration of sufficient length to contain the character sequence and a terminating null -termination character. It is unspecified whether these arrays of string literals are distinct from each other. The behavior is undefined if a program attempts to modify any string literals but . Modifying a string literal frequently results in an access violation because string literals are typically stored in read-only memory. See also undefined behavior 33  of Annex J of the C Standard [ISO/IEC 9899:2011].

...

Do not attempt to modify a string literal. Use Instead, use a named array of characters to obtain create a modifiable copy of a string literal.

Noncompliant Code Example

...