PE> char x[5] = "hello";
PE> comes up with an error, "too many initializers".
Ref ISO 6.5.7, "An array of character type may be initialized
by a character string literl, optionally enclosed in braces.
Successive characters of the character string literal (including the
terminating null character if there is room or if the array is of
unknown size) initialize the elements of the array.
Example 7 (paraphrased). The declaration char t[3] = "abc" is
identical to char t[] = { 'a', 'b', 'c' };
ISO C 6.5.7 is the equivalent of ANSI C 3.5.7.
BFN. Paul.
@EOT:
---
* Origin: X (3:711/934.9)
|