
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
What are the differences between a multi-dimensional array and jagged array?
Multi-dimensional array
Multi-dimensional arrays are also called rectangular array. You can define a 3-dimensional array of integer as −
int [ , , ] val;
Let us see how to define a two-dimensional array.
int[,] val = new[3,3]
Jagged array
A Jagged array is an array of arrays. To access an element from it, just mention the index for that particular array.
Here, we have a jagged array with 5 array of integers −
int[][] a = new int[][]{new int[]{0,0},new int[]{1,2}, new int[]{2,4},new int[]{ 3, 6 }};
- Related Articles
- Multi-Dimensional Array in Javascript
- What is a multi-dimensional array in C language?
- What is the simplest multi-dimensional array in C#?
- Reduce a multi-dimensional array in Numpy
- Reduce a multi-dimensional array and multiply elements in Numpy
- Reduce a multi-dimensional array and add elements in Numpy
- Greatest element in a Multi-Dimensional Array in JavaScript
- What are the differences between a dictionary and an array in C#?
- Converting multi-dimensional array to string in JavaScript
- Reduce a multi-dimensional array along given axis in Numpy
- Reduce a multi-dimensional array along axis 1 in Numpy
- Reduce a multi-dimensional array along negative axis in Numpy
- Java Program to convert array to String for one dimensional and multi-dimensional arrays
- What are the differences between a list collection and an array in C#?
- Merging duplicate values into multi-dimensional array in PHP

Advertisements