Mail Archives: djgpp/1997/12/25/02:45:55
On Wed, 24 Dec 1997, Noam Rotem wrote:
> >> char line[4][2] = {
> >> {2,1,2,1},
> >> {3,4,2,1}
> >> };
> >
> >I don't think this is the correct initialization. The
> correct one should
> >include 4 arrays of 2 numbers, not 2 arrays of 4.
>
> It's wrong, and the compiler shouldn't compile it.
> Initializing a row of 2 values with 4 values is an error of
> syntax..
>
> Is there any methodic reason for ignoring this error, or is
> it a bug of the compiler?
What bug? The above code *is* wrong, and the compiler rightfully
complains about it. The code below is the right one, and the compiler
compiles it without any warnings (I've just tried):
char line[4][2] = { {2,1}, {2,1}, {3,4}, {2,1} };
So what error do you want to ignore, and why do you think the compiler
might have a bug here?
- Raw text -