Mail Archives: djgpp/1997/12/23/10:02:12
On Tue, 23 Dec 1997, Grzegorz Adam Hankiewicz wrote:
> char line[4][2] = {2,1,2,1,
> 3,4,2,1};
>
> The compiler points me to that line and says:
>
> l.c(5) Warning: missing braces around initializer for `line[0]'
>
> I guess you can figure out my question. How do I avoid these 'missing
> braces' warnings?
You say this instead (untested!):
char line[4][2] = { {2,1}, {2,1}, {3,4}, {2,1} };
You also yell at the lazy author of the original code who wanted to
exploit the fact that omitting the second level of braces only causes
a warning in C.
- Raw text -