I am trying to initialize 2-dimensional array of integer values with -1. When I create a new array, it is automatically filled with 0. I know I can do it with 2 for cycles,
Try something like this: int[,] array2D = new int[,] { { -1 }, { -1 }, { -1 }, { -1} };
int[,] array2D = new int[,] { { -1 }, { -1 }, { -1 }, { -1} };
or with dimension int[,] array2D = new int[4,2] { { -1,-1 }, { -1,-1 }, { -1,-1 }, {-1,-1} };
int[,] array2D = new int[4,2] { { -1,-1 }, { -1,-1 }, { -1,-1 }, {-1,-1} };