initializing an array

T. William Wells bill at twwells.uucp
Thu May 11 13:28:21 AEST 1989


In article <609 at greens.UUCP> matthew at sunpix.UUCP ( Sun Visualization Products) writes:
: |     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.

Wrong. A trailing comma in an initializer is perfectly legal. The
problem with his code is that, while what he wants is possible, it is
not part of the language.

---
Bill                            { uunet | novavax } !twwells!bill



More information about the Comp.lang.c mailing list