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

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -