• Advertisement

Archived

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

Array problem

This topic is 6289 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

Ok i want to create an array that holds the values 00, 01 etc to 20. this is what i have so far [source] int IntArray[5][2]; for (int a=0;a<5;a++) { for (int b=0;b<10;b++) { IntArray=???; } } [\source] im not sure if this is correct and i dont know what to put in place of ??? because i have tried many things and i either get errors or the program crashes. Can someone help? Thanks for your time '' Target=_Blank>Link "People spend too much time thinking about the past, whatever else it is, its gone"-Mel Gibson, Man Without A Face

Share this post


Link to post
Share on other sites
Advertisement
That''s not a very clear explanation, but I''ll give it a shot. Try this:

    
int intArray[5][2];
for (int i = 0; i < 5; i++) {
intArray<i>[0] = i*2;
intArray[i][1] = i*2+1;
}


Dormeur

Share this post


Link to post
Share on other sites

  • Advertisement