Reputation: 171
What I would like to do in my code is something like that below:
public static class DataClass
{
public static byte[,,] Array3d = { { {0,0},{0,0}},{{0,0},{0,0}}};
}
class MyClass
{
public MyClass()
{
someMethod(DataClass.Array3d[0]);
someMethod(DataClass.Array3d[1]);
}
void someMethod(byte[,])
{
}
}
I would like to know if there is some way to do what I am trying to when calling someMethod()
. If not, what should I do?
Upvotes: 1
Views: 493
Reputation: 5755
You could just pass your 3D-array to the method. There is nothing preventing you from doing only operations on the relevant 2D subsection in the method.
You could also use a jagged array, but that comes at a heavy cost which I'm not sure is acceptable if you use a 3D-array in the first place.
Upvotes: 1