T Tonyukuk Mar 20, 2004 #1 For example I have an 2D array. int [,] array=new int[2,2]; and I can convert it into one[4] how can I do that ?
For example I have an 2D array. int [,] array=new int[2,2]; and I can convert it into one[4] how can I do that ?
V Vanessa Mar 20, 2004 #2 Every 2D array is in fact a one D array... The rows are behind each other. So you have to split it up. Tonyukuk said: For example I have an 2D array. int [,] array=new int[2,2]; and I can convert it into one[4] how can I do that ? Click to expand...
Every 2D array is in fact a one D array... The rows are behind each other. So you have to split it up. Tonyukuk said: For example I have an 2D array. int [,] array=new int[2,2]; and I can convert it into one[4] how can I do that ? Click to expand...
? =?ISO-8859-1?Q?Carlos_Guzm=E1n_=C1lvarez?= Mar 20, 2004 #3 Hello: For example I have an 2D array. int [,] array=new int[2,2]; and I can convert it into one[4] how can I do that ? Click to expand... Try using Buffer.BlockCopy
Hello: For example I have an 2D array. int [,] array=new int[2,2]; and I can convert it into one[4] how can I do that ? Click to expand... Try using Buffer.BlockCopy
E Emad Barsoum Mar 20, 2004 #4 Hi, To convert 2D to 1D: for(int i=0;i<2;i++) for(int j=0;j<2;j++) { one[j + i*2] = array[i,j]; } Regards, Emad Tonyukuk said: For example I have an 2D array. int [,] array=new int[2,2]; and I can convert it into one[4] how can I do that ? Click to expand...
Hi, To convert 2D to 1D: for(int i=0;i<2;i++) for(int j=0;j<2;j++) { one[j + i*2] = array[i,j]; } Regards, Emad Tonyukuk said: For example I have an 2D array. int [,] array=new int[2,2]; and I can convert it into one[4] how can I do that ? Click to expand...