From Jason Turner

[dcl.init.string]

Diff to HTML by rtfpessoa

tmp/tmpvq2sgfec/{from.md → to.md} RENAMED
@@ -6,25 +6,33 @@ narrow string literal, `char16_t` string literal, `char32_t` string
6
  literal, or wide string literal, respectively, or by an
7
  appropriately-typed string literal enclosed in braces ([[lex.string]]).
8
  Successive characters of the value of the string literal initialize the
9
  elements of the array.
10
 
 
 
11
  ``` cpp
12
  char msg[] = "Syntax error on line %s\n";
13
  ```
14
 
15
  shows a character array whose members are initialized with a
16
  *string-literal*. Note that because `'\n'` is a single character and
17
  because a trailing `'\0'` is appended, `sizeof(msg)` is `25`.
18
 
 
 
19
  There shall not be more initializers than there are array elements.
20
 
 
 
21
  ``` cpp
22
  char cv[4] = "asdf"; // error
23
  ```
24
 
25
  is ill-formed since there is no space for the implied trailing `'\0'`.
26
 
 
 
27
  If there are fewer initializers than there are array elements, each
28
  element not explicitly initialized shall be zero-initialized (
29
  [[dcl.init]]).
30
 
 
6
  literal, or wide string literal, respectively, or by an
7
  appropriately-typed string literal enclosed in braces ([[lex.string]]).
8
  Successive characters of the value of the string literal initialize the
9
  elements of the array.
10
 
11
+ [*Example 1*:
12
+
13
  ``` cpp
14
  char msg[] = "Syntax error on line %s\n";
15
  ```
16
 
17
  shows a character array whose members are initialized with a
18
  *string-literal*. Note that because `'\n'` is a single character and
19
  because a trailing `'\0'` is appended, `sizeof(msg)` is `25`.
20
 
21
+ — *end example*]
22
+
23
  There shall not be more initializers than there are array elements.
24
 
25
+ [*Example 2*:
26
+
27
  ``` cpp
28
  char cv[4] = "asdf"; // error
29
  ```
30
 
31
  is ill-formed since there is no space for the implied trailing `'\0'`.
32
 
33
+ — *end example*]
34
+
35
  If there are fewer initializers than there are array elements, each
36
  element not explicitly initialized shall be zero-initialized (
37
  [[dcl.init]]).
38