Jump to content
  • Advertisement

Archived

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

aDasTRa

[quick array question]

This topic is 6010 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!