Mail Archives: djgpp/2003/08/05/07:01:07
JBS30000 <jbs30000 AT aol DOT com> wrote:
> I figured out the problem. The array goes 0-5, 0-6, 0-5 but I was
> supposed to put unsigned char Dither[6][7][6]; Like I said, the
> answer was very obvious. Sorry about that.
Nothing to be sorry about. Here's another suggestion to improve the quality
of that source code a bit:
1) lose those tons of commented-out numbers. They really make the
code hard to read for no apparent gain.
2) You have an array of arrays of arrays of numbers, here, but your
initializer doesn't reflect that. The language does allow the way you
did it, overflowing from one sub-array into the next, but it's not
particularly good style. Instead, consider
unsigned char Dither [6][7][6] = {
{ { first sub-sub-array},
{ second sub-sub-array} },
{ {first sub-sub-array in second sub-array},
{ ... } },
{ ... }
};
The indentation is just visual sugar, but the additional pairs of { }
provide real value --- they'll make it harder to miscount entries
inside the array.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -