I have a 2d array a[3,3]. How can I express one dimension as a new array and pass it to some function?
int[,] a = new int[3,3];
a[0,0] = 1;
...
string b = concatenate(a[0]); // where concatenate is a function
// take a one dimension array as param
Also, can I create a 65000x65000 array with C#? I got some "out of memory" error.
The easiest way to handle this is to create a jagged array
int[][] i = new int[3][];
that way:
string b = concatenate(i[0]); will work.
To your second question you will run into issues with the LOH with objects approaching that size. This is probably not your problem though. I would look here as to a possible explanation as to why.
You will need to use jagged arrays.
int[][] a = new int[3][]
a[0] = new int[3];
a[1] = new int[3];
a[2] = new int[3];
a[0][0] = 1;
string b = concatentate(a[0]);
Also, creating a 65000x65000 array would result in 65000^2 = 4225000000 slots (or about 16GB or data) so it is no wonder that you are getting an OutOfMemoryException.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With