Defect Report #060
Submission Date: 19 Jul 93
Submittor: Project Editor (P.J. Plauger)
Source: Larry Jones
Question
When an array of char (or wchar_t) is initialized with
a string literal that contains fewer characters than the array, are
the remaining elements of the array initialized?
Subclause 6.5.7 Initialization, page 72, only says (emphasis
mine):
If there are fewer initializers in a brace-enclosed list
than there are members of an aggregate, the remainder of the aggregate
shall be initialized implicitly the same as objects that have static
storage duration.
Correction
In subclause 6.5.7, page 72, the penultimate paragraph of Semantics
(before Examples), add after the comma:
or fewer characters in a string literal or wide string literal used
to initialize an array of known size, and elements of character or
wchar_t type
Previous Defect Report
< - >
Next Defect Report