Im trying to print a Int 2D array with a null value. Which is basically like assigning a space in String array.
int[,] arr = new int[10, 10];
for (int temp = 0; temp < arr.GetLength(0); temp++)
{
for (int temp2 = 0; temp2 < arr.GetLength(1); temp2++)
{
arr[temp, temp2] = xxxxx ;
}
}
for (int xIndex = 0; xIndex < arr.GetLength(0); xIndex++)
{
for (int yLoop = 0; yLoop < arr.GetLength(1); yLoop++)
{
Console.Write(arr[xIndex, yLoop]);
}
Console.WriteLine();
}
So far I tried assigning null value but I got "Cannot convert null to 'int' because it is a non-nullable value type. If I dont assign any value it just simply output 0 's and I want it to be display nothing in console.