Mail Archives: djgpp/2000/01/20/09:31:04
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote:
> On Wed, 19 Jan 2000, David Cleaver wrote:
>> unsigned char table011[][] = {{ 0, 0},
> This is not valid C: you can't leave both dimensions unspecified.
> Only the last dimension can be left unspecified.
Close, but it's exactly the other way round: it's the *first*
array dimension that can be left open, i.e.:
unsigned char table011[][2] = {{ 0, 0},
is the right way.
And, as a related issue, no initialized variable definition like this
should usually be put into a header file. You'ld get "multiple
definition" errors from the linker, if this header file is linked into
more than one .c file. Instead, have 'extern unsigned char
table[][2];' in the header, and move the initialized definition into
the .c file (or a 'private header' which is not made visible to users
of this code module).
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -