unittest { int[][] matrix = new int[][](n,m); //Getting a collumn is simple. int[] collumn0 = matrix[0];//Getting a row is trickier int[] row0; //Loop over all collumns foreach(i; matrix) { row0 ~= matrix[i][0]; } }
Sry the way you get rows is wrong. It should be int[] row0; foreach(collumn; matrix) row0 ~= collumn[0]; and not
int[] row0; //Loop over all collumns foreach(i; matrix) { row0 ~= matrix[i][0]; }