I'm trying to create a two-dimensional array of my custom class Cell
with the following code:
public class Cell
{
int top;
int bottom;
}
public Form1()
{
Cell[,] elements;
elements = new Cell[10,10];
Random r = new Random();
for (int i=0; i!=10; i++)
{
for (int j=0; j!=10; j++)
{
elements[i,j].top = r.Next();
}
}
}
But I always receive the following error: Inconsistent accessibility: ... and something about 'Cell is less accesible'...
How do I correctly define a two-dimensional array of a custom class?