Title
Omitted array bound with string initialization
Status
drafting
Section
9.4.3 [dcl.init.string]
Submitter
Nikolay Ivchenkov

Created on 2011-04-26.00:00:00 last changed 165 months ago

Messages

Date: 2012-09-24.00:00:00

The example in 9.4.3 [dcl.init.string] paragraph 1 says,

  char msg[] = "Syntax error on line %s\n";

shows a character array whose members are initialized with a string-literal. Note that because '\n' is a single character and because a trailing '\0' is appended, sizeof(msg) is 25.

However, there appears to be no normative specification of how the size of the array is to be calculated.

History
Date User Action Args
2011-04-26 00:00:00admincreate