Below code creates the error message in the subject line. Could you please help? I am trying to instantiate below class as an object. I think the error is caused by the array that I am trying to declare.
class DataStuff
{
public double G { get; set; }
public double[,] M { get; set; }
public void UpdateData()
{
G = 500;
}
public void UpdateMatrixData()
{
for(int i=0; i<2; i++)
{
for (int j = 0; j < 2; j++)
{
M[i, j] = i + j;
}
}
}
}