Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!xanth!mcnc!rti!sunpix!matthew From: matthew@sunpix.UUCP ( Sun Visualization Products) Newsgroups: comp.lang.c Subject: Re: initializing an array Keywords: multi-dimension, no size specified. Message-ID: <609@greens.UUCP> Date: 8 May 89 21:02:15 GMT References: <12814@ut-emx.UUCP> Organization: Sun Microsystems, Research Triangle Park, NC Lines: 25 In article <12814@ut-emx.UUCP>, reeder@ut-emx.UUCP (William P. Reeder) writes: | I can initialize a simple array like this: | int a[] = { 1, 2, 3 }; | and C will figure out that a must have 3 elements. But what if | my array has two dimensions? | int a[][] = { | { 1, 2, 3 }, | { 4, 5, 6 }, | { 7, 8, 9 }, <------ remove this excess ',' | }; | | It is possible to determine from the syntax how many elements there | are in each dimension, but my compiler complains about a null | dimension. | Of course it going to complain about a null dimension. You've got an extra ',' in the initializer declaration. -- Matthew Lee Stier | Sun Microsystems --- RTP, NC 27709-3447 | "Wisconsin Escapee" uucp: { sun, mcnc!rti }!sunpix!matthew | phone: (919) 469-8300 fax: (919) 460-8355 |