Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!gauss.rutgers.edu!math.rutgers.edu!bumby From: bumby@math.rutgers.edu (Richard Bumby) Newsgroups: comp.lang.c Subject: Re: array declaration Message-ID: Date: 10 May 89 19:50:04 GMT References: <12724@umn-cs.CS.UMN.EDU> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 38 Cc: bumby In article <12724@umn-cs.CS.UMN.EDU> clark@umn-cs.CS.UMN.EDU (Robert P. Clark) writes: > There is lots of talk about why > > int a[][] = { > > }; > > > won't compile. My compiler barfs at this too. But if > you change the declaration to > > static int a[][] = { > > }; > > it compiles fine. This is what I do to get around the > problem, but I'm not exactly sure why this works and the > first doesn't. Can anyone shed some light on this? > > ... ... My guess is that your (unidentified) compiler is just providing an extension of the type suggested by the original poster in a context where it would be reasonably safe. I used the first edition of K & R as a reference, but have done no experiments with the various C environments that I have access to (I guess I am still just a pure mathematician). I found that section 5.7 was sufficiently clear about declaration and use of multidimensional arrays, and section 8.4 of the reference manual (appendix A) about the limitation of "arrays of unknown size" that I never pursued the matter further. -- -- --R. T. Bumby ** Math ** Rutgers ** New Brunswick ** (in one form or another for all kinds of mail) [bumby@math.rutgers.edu]