CSharp examples for System:Array Dimension
Allocate a 2D array of bools.
// Licensed under the Apache License, Version 2.0 (the "License"); using System.Collections.Generic; using System;//w ww. j ava2 s . c o m public class Main{ /// <summary> /// Allocate a 2D array of bools. /// </summary> /// <param name="rows">The number of rows.</param> /// <param name="cols">The number of columns.</param> /// <returns>The array.</returns> public static bool[][] AllocateBool2D(int rows, int cols) { var result = new bool[rows][]; for (int i = 0; i < rows; i++) { result[i] = new bool[cols]; } return result; } }