TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: All
from: Paul Edwards
date: 1995-08-23 09:05:18
subject: Re: SAS/C bug!!!

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)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.