• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# [quick array question]

## Recommended Posts

i have a 2d array set up like this: list[x][3] (x is an arbitrary number) i want to fill 'list' without 3(x) assignments, like:
  list[0][0] = //number list[0][1] = //number ... list[x-1][2] = //number 
i am thinking something like
  list[0] = // number, number, number list[1] = // number, number, number ... 
anyone know how to do this? i appreciate the help <(o)> Edited by - aDasTRa on January 31, 2002 9:53:05 PM

##### Share on other sites
Does this work ?

  array[0] = { nb1, nb2, nb3 }

I''ve never done this... it''s jsut theory, so that''s it !

/* Bullmax */
-------------
Reality has many forms : good and evil, black and white, ying and yang.

##### Share on other sites
no it doesn''t work; thats the first thing i tried. actually i tried all three types of brackets (, [, {, and none worked.

<(o)>

##### Share on other sites
That can only be done on initialization. Like this:
  int fish[2][3] = { { 0, 1, 2 }, { 3, 4, 5 } };

But that won''t work at other times, you have to write it out.

##### Share on other sites
thats what i was fearing. thanks anyways

<(o)>

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627643
• Total Posts
2978363

• 10
• 12
• 22
• 13
• 33