Return Rectangular Int Array - CSharp System

CSharp examples for System:Array Dimension

Description

Return Rectangular Int Array

Demo Code



public class Main{
        internal static int[][][] ReturnRectangularIntArray(int Size1, int Size2, int Size3)
        {//from ww w . j av  a  2s  . c  o m
            int[][][] Array;
            if (Size1 > -1)
            {
                Array = new int[Size1][][];
                if (Size2 > -1)
                {
                    for (int Array1 = 0; Array1 < Size1; Array1++)
                    {
                        Array[Array1] = new int[Size2][];
                        if (Size3 > -1)
                        {
                            for (int Array2 = 0; Array2 < Size2; Array2++)
                            {
                                Array[Array1][Array2] = new int[Size3];
                            }
                        }
                    }
                }
            }
            else
                Array = null;

            return Array;
        }
}

Related Tutorials