[Solved] Combining two single dimensional arrays in a 2D array in c#


Didn’t tryed this, and I’m just guessing what you want to acomplish, but here it is:

int[] arrayRow;
int[] arrayCol;

int[,] myArray = new int[Math.Max(arrayRow.Length, arrayCol.Length), 2];

for (int i = 0; i < arrayRow.Length; i++)
  myArray[i, 0] = arrayRow[i];

for (int i = 0; i < arrayCol.Length; i++)
  myArray[i, 1] = arrayCol[i];

solved Combining two single dimensional arrays in a 2D array in c#