Re: arrays in c

  • From: "Marlon Brandão de Sousa" <splyt.lists@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Thu, 18 Oct 2007 20:37:16 -0300

The more dimensions the array has the more braces you will use. A
brace will delimite values for one dimension, so that's why you can't
write your example the first way ..
Marlon

2007/10/18, Daniel Dalton <daniel.dalton47@xxxxxxxxx>:
> Hi,
>
> Thanks to everyone who helped me with my last question.
> I was just wondering is it ok to write this?
> int array [4] = {{1, 3},
> {4, 7}};
> or can you only use the double braces for this sort of declaration?
> int array [2][2] ={{1, 2},
> {2, 5}};
> I think that is how you write it.
> I seem to get warnings if I write the first example.
> So can I only use two lots of braces for Multidimensional arrays?
>
> Thanks.
>
> -- Daniel Dalton
> http://members.iinet.net.au/~ddalton
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>
>


-- 
When you say "I wrote a program that crashed Windows," people just
stare at you blankly and say "Hey, I got those with the system, for
free."
Linus Torvalds
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: