About 3,750 results
Open links in new tab
  1. 2D Arrays in C# with Examples - Dot Net Tutorials

    Mar 23, 2019 · Let us understand how to initialize a 2D Array with an example. Please have a look at the following statement which shows the declaration and initialization of a 2D Array. This is the declaration + initialization of a 2Dimensinal array in C#. …

  2. C# Multidimensional Arrays - W3Schools

    To access an element of a two-dimensional array, you must specify two indexes: one for the array, and one for the element inside that array. Or better yet, with the table visualization in mind; one for the row and one for the column (see example below).

  3. c# - Multidimensional Array [] [] vs [,] - Stack Overflow

    Sep 24, 2012 · double[,] is a 2d array (matrix) while double[][] is an array of arrays (jagged arrays) and the syntax is: double[][] ServicePoint = new double[10][];

  4. C# Multidimensional Arrays - GeeksforGeeks

    Jan 15, 2025 · Step 1: Declare the Multi-Dimensional Array with fixed number of rows and columns. Step 2: Iterate the elements of array position and then assigning the values to it using ReadLine() Method. Step 3: Iterate and Printing the elements of Array. Example: C#

  5. The array reference type - C# reference | Microsoft Learn

    Dec 14, 2024 · The first declaration declares an uninitialized array of five integers, from array[0] to array[4]. The elements of the array are initialized to the default value of the element type, 0 for integers. The second declaration declares an array of …

  6. C# declaring a 2D array - Stack Overflow

    Mar 9, 2012 · A 2-dimensional array is a list of one-dimensional arrays. A 2-dimensional array can be thought of as a table, which has x number of rows and y number of columns. Following is a 2-dimensional array, which contains 3 rows and 4 columns −

  7. C# Multidimensional Array (With Examples) - Programiz

    Here's how we declare a 2D array in C#. Here, x is a two-dimensional array with 2 elements. And, each element is also an array with 3 elements. So, all together the array can store 6 elements (2 * 3). Note: The single comma [ , ] represents the array is …

  8. C# Multidimensional Arrays: 2D, 3D & 4D - TutorialsTeacher.com

    C# supports multidimensional arrays up to 32 dimensions. The multidimensional array can be declared by adding commas in the square brackets. For example, [,] declares two-dimensional array, [, ,] declares three-dimensional array, [, , ,] declares four-dimensional array, and so on.

  9. C# Multidimensional Arrays - C# Tutorial

    When an array has more than one dimension, it is called a multidimensional array. The following example declares a two-dimensional array (or 2D array) of two rows and three columns. The comma (,) inside the square brackets denotes the number of dimensions.

  10. What is 2D Array In C# - C# Corner

    In C#, a 2D array is declared by specifying the number of rows and columns: int[,] myArray = new int[3, 4];. This creates a 2D array with three rows and four columns, with each element initialized to its default value (0 for int).

Refresh