Article View: comp.std.c
Article #5578Question on declaration semantics
From: Curt Wohlgemuth
Date: Sat, 14 Jan 1989 00:24
Date: Sat, 14 Jan 1989 00:24
31 lines
1038 bytes
1038 bytes
I have a question on ANSI C declaration semantics. Here is a code
snippet:
......... (file scope)
int a[5];
int a[] = {1, 2, 3};
......... (end of snippet)
Are these declarations an invalid combination? (I.e., is this
non-conforming?)
And if these are valid, how about reversing them?
......... (file scope)
int a[] = {1, 2, 3};
int a[5];
......... (end of snippet)
As you can probably tell, I'm interested in just where the size of the
empty-bracketed "a" is to be "filled in". Before the '=', or at the end
of the initializer?
Any and all comments would be appreciated.
Thanks,
Curt Wohlgemuth
Technical Details
Message-ID:
<16490010@hpcllca.HP.COM>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ames!xanth!ukma!gatech!purdue!decwrl!hplabs!hpda!hpcuhb!hpcllla!hpcllca!curtwShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ames!xanth!ukma!gatech!purdue!decwrl!hplabs!hpda!hpcuhb!hpcllla!hpcllca!curtw From: curtw@hpcllca.HP.COM (Curt Wohlgemuth) Newsgroups: comp.std.c Subject: Question on declaration semantics Message-ID: <16490010@hpcllca.HP.COM> Date: 14 Jan 89 00:24:51 GMT Organization: HP NSG/ISD California Language Lab Lines: 31