Allocate 3D Double array - CSharp System

CSharp examples for System:Array Dimension

Description

Allocate 3D Double array

Demo Code

// Licensed under the Apache License, Version 2.0 (the "License");
using System.Collections.Generic;
using System;//w  w  w.j av  a 2  s.  com

public class Main{
        public static double[][][] AllocDouble3D(int x, int y, int z)
        {
            var result = new double[x][][];
            for (int i = 0; i < x; i++)
            {
                result[i] = new double[y][];
                for (int j = 0; j < y; j++)
                {
                    result[i][j] = new double[z];
                }
            }
            return result;

        }
}

Related Tutorials