CSharp examples for System:Array Dimension
Convert One Dimension Array To Three Dimension Array
using System.Text; using System.Linq; using System.Collections.Generic; using System;/*w ww . j av a2s. c o m*/ public class Main{ public static T[, ,] ConvertOneDArrayToThreeDArray<T>(int x, int y, int z, T[] data) { T[, ,] result = new T[x, y, z]; int zPos, yPos, xPos; for (int i = 0; i < data.Length; i++) { zPos = (i % (x * y)) % z; yPos = (i % (x * y)) / z; xPos = i / (x * y); result[xPos, yPos, zPos] = data[i]; } return result; } }