Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!lll-lcc!lll-winken!uunet!mcvax!hp4nl!botter!star.cs.vu.nl!maart From: maart@cs.vu.nl (Maarten Litmaath) Newsgroups: comp.lang.c Subject: Re^2: initializing an array Keywords: multi-dimension, no size specified. Message-ID: <2474@solo8.cs.vu.nl> Date: 9 May 89 17:39:09 GMT References: <12814@ut-emx.UUCP> <609@greens.UUCP> Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 30 matthew@sunpix.UUCP ( Sun Visualization Products) writes: \In article <12814@ut-emx.UUCP>, reeder@ut-emx.UUCP (William P. Reeder) writes: \... \| int a[][] = { \| { 1, 2, 3 }, \| { 4, 5, 6 }, \| { 7, 8, 9 }, <------ remove this excess ',' ^^^^^^ Bullshit! \| }; \| \| It is possible to determine from the syntax how many elements there \| are in each dimension, but my compiler complains about a null \| dimension. It is NOT possible! Compare with the following LEGAL code: int a[][5] = { { 0, 1, 2 }, }; \Of course it going to complain about a null dimension. You've got an extra ',' \in the initializer declaration. Nonsense! The extra comma is perfectly valid. Try figure out why this feature was added to the language! Hint: can you say `code generator'? People: PLEASE verify your `solutions' before posting. -- "If it isn't aesthetically pleasing, |Maarten Litmaath @ VU Amsterdam: it's probably wrong." (jim@bilpin) |maart@cs.vu.nl, mcvax!botter!maart