0

Does some body how to create n(for example n=10000) arrays with a for loop which each array has its own index?
Array[,] number 1
Array[,] number 2
Array[,] number 3
.
.
.
I tried this code:

for (i=1;i<=10000;i++) { // create 2-dim array with index i }
4
  • Do you mean an array of arrays? Can you post the code you tried? Commented Jul 17, 2013 at 9:51
  • What problems are you experiencing? What have you tried? Commented Jul 17, 2013 at 9:52
  • for(i=0;i<=10000;i++) { //create 2-dim array[,] with index i } Commented Jul 17, 2013 at 9:55
  • 1
    Then what!!! Edit your question and provide more details Commented Jul 17, 2013 at 9:55

1 Answer 1

1

You can make an array of (2d) arrays.

int [][,] data = new int[10000][,];
for (int i = 0; i < data.Length; i++)
   data[i] = new int[2,2];

data[z][x,y] = 123;
Sign up to request clarification or add additional context in comments.

2 Comments

what if i don't want to use array of arrays? i mean a code like the one i tried.
Make that more concrete. In the question, not in the comments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.