C++ 标准草案
http://www.cs.unc.edu/~smithja/C++Nov97/www.cygnus.com/misc/wp/nov97/decl.html#dcl.init.string
8.5.2 Character arrays [dcl.init.string]
1 A char array (whether plain char, signed char, or unsigned char) can
be initialized by a string-literal (optionally enclosed in braces); a
wchar_t array can be initialized by a wide string-literal (optionally
enclosed in braces); successive characters of the string-literal ini-
tialize the members of the array. [Example:
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. ]
2 There shall not be more initializers than there are array elements.
[Example:
char cv[4] = "asdf"; // error
is ill-formed since there is no space for the implied trailing '\0'.
]
C Programming Language
http://www-ccs.ucsd.edu/c/declare.html#Object%20Initializers
You can initialize an array of any character type by writing a string literal, or an array of wchar_t by writing a wide character string literal, as shorthand for a sequence of character constants. The translator retains the terminating null character only when you initialize an object of incomplete array type. (An object of complete array type is padded as needed with trailing zero initializers.)
For example:
char fail[6] = "fail"; same as {'f', 'a', 'i', 'l', 0, 0}
char bad[] = "bad"; same as {'b', 'a', 'd', '\0'}
wchar_t hai[3] = L"hai"; same as {L'h', L'a', L'i'}
But note: