Hello guys. I have declared a 3D Global integer array:
namespace Math { public static class GV { public static int[][,] a; public static void InstantiationArray(int[,] a, int n, int m) { for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) a[i, j] = new int(); } } }
And in my form, when a button is pressed, the next code is executed:
GV.a[0] = new int[n, m]; GV.InstantiationArray(GV.a[0], n, m);
and when I run the program I get this Exception: Object reference not set to an instance of an object.