How to Make Arrays with Code

How do I make a script that makes a certain amount of arrays defined by a variable. Like if I have a variable called a and I set it equal to 5 how do I make 5 arrays? I though it would be something like:

public int a;

for(int i = 0; i < a; a++){
    int[] data = new int[someNumber]
}

But then every array would be called “data” which means I can’t access just 1 array. I suppose an alternative would be to make a multidimensional array but then the question becomes how do you set the number of dimensions to “a”. So what should I do?

int[,] data = new int[a, someNumber];

I believe what you are looking for is a multi-dimensional array. In javascript:

function Start(){
	var a : int[,] = new int[2,2];
	a[0,0] = 1;
	a[0,1] = 2;
	a[1,0] = 3;
	a[1,1] = 4;
	print(a[1,0]);
}

int a;
int data;

data = new int[a][];

for (int i=0; i<a; i++)
    data *= new int[yourArraySize];*

Do note that Eric5h5’s is also valid, just showing a different approach. int[,] creates a c# multi dimensional array, which is fixed size and essentially is just a neat way to represent int[width*height];
int[][] creates a jagged array, which is an array of arrays, in which case data itself is an array and contains all the methods and properties of arrays, and each member of data is also an array by itself. Do note that if you use this method, you will have to instantiate every single “sub” array instance individually.