arrays - Trying to convert an int[] into int[,] using C# -
i function convert single dimension array int[480000] 2d array of size int[800,600]. can please me how can done?
public static t[,] convert<t>(this t[] source, int rows, int columns) { int = 0; t[,] result = new t[rows, columns]; (int row = 0; row < rows; row++) (int col = 0; col < columns; col++) result[row, col] = source[i++]; return result; }
Comments
Post a Comment